Dear R helpers,
I am working with R 2.4.1 GUI 1.18 (4038) for MacOSX. I have a matrix of
10 000 genes and try to run the following commands:
model.mix-makeModel (data=data, formula=~Dye+Array+Sample+Time,
random=~Array+Sample)
anova.mix-fitmaanova (data, model.mix)
test.mix-matest (data,
If I want to find out the soltion of X1,X2
that min(3X1+2X2+X1X2) subject to
20=X1+3X2=50
10=X1
which function or package can I use?
Thanks.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Hi
you probably know that the second column are dates but your poor PC
does not, so you should to tell him.
You have several options:
Change the column to suitable date format - see chron package or help
pages related to date functions e.g. strptime, as.Date, ... and
perform your plot.
See argument drop.unused.levels in xyplot. You will also need to
manage the case n = 0 for dispalying the mean and stdv.
Best,
Renaud
histogram(~ resp | group, drop.unused.levels = FALSE,
panel = function(x, ...){
std - if(length(x) 0) format(round(sd(x), 2), nsmall = 2) else NA
n -
Dear List,
I was asked to calculate a confidence interval for p*p. Is there any standard
techniques for calculating such an interval? Delta Method?
Thank you in advance!
Cheers, Patrik
__
R-help@stat.math.ethz.ch mailing list
It is not really an argument to mmatplot; it is an argument to mapply and I
am not certain what might be happening in there with respect to lazy
evaluation. Yes you can set it up with lapply, but I don't think speed is a
concern since most of the time is being spent in the matplot routine. If
Hi R-helpers,
I'm new to time series modelling, but my requirement seems to fall just
outside the capabilities of the arima function in R. I'd like to fit an
ARMA model where the variance of the disturbances is a function of some
exogenous variable. So something like:
Y_t = a_0 + a_1 * Y_(t-1)
On 05-Mar-07 Öhagen Patrik wrote:
Dear List,
I was asked to calculate a confidence interval for p*p. Is there any
standard techniques for calculating such an interval? Delta Method?
Thank you in advance!
Cheers, Patrik
If p is meant to denote a probability between 0 and 1, then
Hi,
Although the solution worked, I'v got some troubles with some data files.
These datafiles are very large (600-700 MB), so my computer starts swapping.
If I use the code, written below, I get:
Error in .Call(R_lazyLoadDBfetch, key, file, compressed, hook, PACKAGE =
base) :
recursive
Hi R Users!
Thanks in advance.
I am using R 2.4.1 on windows XP.
I have a series of (x[i,t], y[i,t]), say i = 1, 2, .., n and t = t1, t2,
.., tT. The n is large in number.
The series y[i,t] is constructed from x[i,t] using moving average of order o
(say o = 30
Hi, I'd suggest you use ?rect for this.
Here's an example (I did not check whether it's correct...)
I also improved (but not checked :) your definition of cols.
Jonne.
X - seq(1:6)
Q - matrix(sample(X, 60, replace = T), nrow=6, byrow = T)
H - matrix(rep(1,60), nrow=6, byrow=T)
color - c(blue,
Dear r-helpers,
I am building a package that depends on some others. I recently added
a new dependency: package outliers. But does not work any more.
Let me show some information below:
[EMAIL PROTECTED]:pcrAnalysis$ cat DESCRIPTION
Package: pcrAnalysis
Type: Package
Title: pcrAnalysis
Version:
Sarthi M. wrote:
I want to display dates on my x-axis of the plot.
Dates are a problem. There's a standard for dates, but it
seems that most users and software didn't catch up :-/
The variable dat is a data frame. The first column has numeric
values and second column has date.
e.g. dat
With help of list(), function can return ala of the results.
my.fun=function(vector, index){
a=fun.a(vector, index)
b=fun.b(vector, index)
return(list(a,b))
}
Example:
R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1 (2005-12-20 r36812)
ISBN
In your test function there is no lexically visible definition for the
`colnum` variable used in defining main, so that error is what you
expect from lexical scoping. Lazy evaluation dictates when (and if)
the `main` argument is evaluated, but the environment in which it is
evaluated is
Hi R,
The below are commands used in extracting Bloomberg data. Let T1,
T2,...T5 be a set of actual tickers
Ticker_list-c(T1, T2, T3, T4, T5)
con-blpConnect(show.days=show_day, na.action=na_action,
periodicity=periodicity)
Hello,
I try to display coloured rectangles behind symbols in a legend (as a
background):
plot(10,10)
legend(top, c(text,text2), pch=c(21,22), fill=c(red,green),
pt.bg=black)
On the resulting graph, the symbol is not centered upon the coloured
rectangle. Is there a way to adjust their
I have code like this: -
#---
--
x=scan()
0 0 0 0 0 1 2 3 4
y=scan()
1 1 1 2 2 1 3 4 5
plot(x,y)
identify(0,1,3) #Allows me to select manually to identify co-ordinate
(0,1)
Hi
I have a plist t which contains size measurements of individual plants,
identified by the field plate. It contains, among other, a field
year indicating the year in which the individual was measured and the
height. The number of measurements range from 1 to 4 measurements in
different
On Mon, 05 Mar 2007 09:14:17 +0100 Sophie Richier [EMAIL PROTECTED] wrote:
Dear R helpers,
I am working with R 2.4.1 GUI 1.18 (4038) for MacOSX. I have a matrix of
10 000 genes and try to run the following commands:
model.mix-makeModel (data=data, formula=~Dye+Array+Sample+Time,
Is there any way to force 0 * NA to be 0 instead of NA?
For example, suppose I have a vector with some valid values, while
other values are NA. If I matrix-pre-multiply this by a weight
row vector, whose weights that correspond to the NAs are zero,
the outcome will still be NA:
x - c(1, NA, 1)
hi,
second try...
I ran into problems when checking one of my packages with R CMD CHECK:
I have two packages, the first (named `pkc') depending on the second one (named
`roiutils'). The source code and DESCRIPTION files describes the dependency as
it should be, I think ('Imports', `require').
We're pleased to announce a one day course covering static and dynamic
graphics using R, ggplot and GGobi. The course will be held just
before the JSM, on Saturday, 28 July 2007, in Salt Lake City. The
course will be presented by Dianne Cook and Hadley Wickham.
In the course you will learn:
*
Hi All,
I'm trying to come up with a clear and concise (and fast?) solution to
the following problem.
I would like to take a vector 'v' and enumerate all of the ways in
which it can be broken into n sets of length 2 (if the length of the
vector is odd, and an additional set of length 1). An
From: Alberto Monteiro
Is there any way to force 0 * NA to be 0 instead of NA?
For example, suppose I have a vector with some valid values,
while other values are NA. If I matrix-pre-multiply this by a
weight row vector, whose weights that correspond to the NAs
are zero, the outcome
Alberto Monteiro napsal(a):
Is there any way to force 0 * NA to be 0 instead of NA?
No (AFAIK), and it is pretty reasonable to define it this way.
If you want to treat the NAs as zeros, use
x[is.na(x)] - 0
Petr
For example, suppose I have a vector with some valid values, while
other values
I need help.
I'm trying to connect with an Oracle DBMS and MySQL DBMS, I'm using
RJDBC package.
My code is the next:
library('rJava')
library('DBI')
library('RJDBC')
//Mysql
drv -
JDBC(com.mysql.jdbc.Driver,C:\\Temporal\\mysql-connector-java-3.0.9-stable-bin.jar,')
conn - dbConnect(drv,
On 05-Mar-07 Alberto Monteiro wrote:
Is there any way to force 0 * NA to be 0 instead of NA?
For example, suppose I have a vector with some valid values, while
other values are NA. If I matrix-pre-multiply this by a weight
row vector, whose weights that correspond to the NAs are zero,
the
Allan
the general problem you refer to is set partitions, although
I'm not clear whether the order of the sets themselves
makes a difference (we in the enumerative combinatorics
world refer to indistinguishable boxes).
Your application would be set partitions with a specific shape,
in this case
David Lloyd wrote:
I have code like this: -
#---
--
x=scan()
0 0 0 0 0 1 2 3 4
y=scan()
1 1 1 2 2 1 3 4 5
plot(x,y)
identify(0,1,3) #Allows me to select
Have a look at ?sunflowerplot, which not only produces a scatterplot
showing multiple points with the same coordinates using special
symbols, but will also produce a list showing the number of points at
each coordinate as well.
On 05/03/07, David Lloyd [EMAIL PROTECTED] wrote:
I have code like
On 05-Mar-07 Petr Klasterecky wrote:
Alberto Monteiro napsal(a):
Is there any way to force 0 * NA to be 0 instead of NA?
No (AFAIK), and it is pretty reasonable to define it this way.
If you want to treat the NAs as zeros, use
x[is.na(x)] - 0
Doing it in precisely that way would have the
Bingshan Li bli1 at bcm.tmc.edu writes:
I am wondering if there is a way in R to fit logistic regression on
contingency table. If I have original data, I can transform the data
into a design matrix and then call glm to fit the regression. But now
I have a 2x3 contingency table with
If you were worried about efficiency and the structure/size of the dataframe
was complex/big, then you could work with the indices only which would be
more efficient:
sapply(split(seq(nrow(t)), t$plate), function(x) t$id[x][which.max
(t$year[x])])
15 20 33 43 44 47
Doug,
It's mitools, not mltools. I wrote it.
I think the problem is just that coef() is not the right function for
getting the fixed effects. Beth wants
betas - MIextract(model0, fun=fixef)
-thomas
On Sat, 3 Mar 2007, Douglas Bates wrote:
On 3/2/07, Beth Gifford [EMAIL
What is wrong with the method that you have? It looks reasonable
efficient. As with other languages, there are always other ways of doing
it. Here is another to consider, but it is basically the same:
sapply(split(t, t$plate), function(x) x$id[which.max(x$year)])
15 20 33
If you want to process 'n' lines from the file, then just setup the file as
a connection and read the desired length in a loop like below:
f.1 - file('/tempxx.txt', 'r')
nlines - 0
# read 1000 lines at a time
while (TRUE){
lines - readLines(f.1, n=1000)
if (length(lines) == 0) break #
Yes, Thomas' solution fixed my mistake. thank you.
On 3/5/07, Thomas Lumley [EMAIL PROTECTED] wrote:
Doug,
It's mitools, not mltools. I wrote it.
I think the problem is just that coef() is not the right function for
getting the fixed effects. Beth wants
betas - MIextract(model0,
You can also do it with the following:
plot(as.POSIXct(strptime(as.character(dat[,2]), %Y%m%d)), dat[,1])
On 3/5/07, d. sarthi maheshwari [EMAIL PROTECTED] wrote:
Hi,
I want to display dates on my x-axis of the plot. I was trying to use
plot()
command for the same and passing the values
Carlos J. Gil Bellosta [EMAIL PROTECTED] writes:
import(methods, Biobase, outliers)
* checking whether the package can be loaded ... ERROR
Loading required package: Biobase
Loading required package: tools
Welcome to Bioconductor
Vignettes contain introductory material. To view, type
Ted Harding wrote:
Is there any way to force 0 * NA to be 0 instead of NA?
No (AFAIK), and it is pretty reasonable to define it this way.
If you want to treat the NAs as zeros, use
x[is.na(x)] - 0
Doing it in precisely that way would have the problem that it
would not give you NA when
Finally I would like to have a data.frame t2 which only contains the
entries of the last measurements.
You could also use aggregate to get the max year per plate then join that back
to the original dataframe using merge on year and plate (common columns in both
dataframes).
-- Forwarded message --
From: amna khan [EMAIL PROTECTED]
Date: Feb 25, 2007 8:37 AM
Subject: RFA and nsRFA
To: [EMAIL PROTECTED], R-help@stat.math.ethz.ch
Dear Sir
There are two packages of regional frequency analysis RFA and nsRFA.
Are both give us same results if not then what
-- Forwarded message --
From: amna khan [EMAIL PROTECTED]
Date: Feb 25, 2007 8:44 AM
Subject: nsRFA
To: R-help@stat.math.ethz.ch, [EMAIL PROTECTED]
Dear Sir
I am not understanding the HOMTESTS in package nsRFA. Is vector x is
the data from all sites combined combined in one
Hi all,
I am hoping someone can help me out with this:
If I have dataframe of years and ages and the first column and first row
are filled with leading values:
Df-age1age2age3
Yr1 1 0.4 0.16
Yr2 1.5 0 0
Yr3 0.9 0 0
-- Forwarded message --
From: amna khan [EMAIL PROTECTED]
Date: Feb 25, 2007 8:51 AM
Subject: RFA
To: R-help@stat.math.ethz.ch, [EMAIL PROTECTED]
Dear Sir in the following example,is the vector lmom a l-moment ratios
vector? What is meant by size = northCascades[,1]? And what are
I was wondering if anyone has created an interface to RRDtool which is a
round robin database that will store timeseries data and aggregate the data
so that the storage footprint stays relatively small (older data summarized
into larger segments).
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
Take advantage of a 20% discount on the most recent R books from Chapman
Hall/CRC!
Chapman and Hall/CRC is pleased to offer our latest books on R - all available
through our website at a 20% discount to users of the software. To take
advantage of this permanent offer, that is valid across the
Dear R-users,
I have two sets of code that appear to me to be equivalent, shown below, and
yet I get the error message
Error in dim(robj) - c(dX, dY) : dim- : dims [product 4] do not match the
length of object [1]
after executing the assignment to logdens2. Both functions post.a1 and
post.a2
I try to install RScaLAPACK on Ubuntu 6.10 and LAM 7.0.x
Does anybody know a useful link top some how-to site about RScaLAPACK.
Now I manage to get the package compiling, but the linker shows me lots
of unsolved references:
sudo R CMD INSTALL RScaLAPACK_0.5.1.tar.gz
Hi,
please help me coding:
model : y = f(x) + e, e ~ N(0, sigma^2)
f(x) = 1/1+x^2
generate {(x_i,y_i), i=1,2,...,n}
x_i: are ordered
H(x_j) = sum_i =1, i neq j-1 y_i+1/x_i+1 - x_j (x_i+1 - x_i )
j = 1, ...,n
find {(x_i, H(x_i)), i = 1, ..., n}
Then
On 05-Mar-07 Alberto Monteiro wrote:
Of course, the problem begins to grow if we want, for example,
to use elementary matrices to transform a matrix. The 2x2 matrix
that switches two lines, rbind(c(0,1), c(1,0)) will not switch
a matrix with NAs:
switch - rbind(c(0,1), c(1,0))
testmatrix
On Mon, 2007-03-05 at 15:31 +, Dieter Menne wrote:
Bingshan Li bli1 at bcm.tmc.edu writes:
I am wondering if there is a way in R to fit logistic regression on
contingency table. If I have original data, I can transform the data
into a design matrix and then call glm to fit the
Comments inside.
Reinman, Grant napsal(a):
Dear R-users,
I have two sets of code that appear to me to be equivalent, shown below, and
yet I get the error message
Error in dim(robj) - c(dX, dY) : dim- : dims [product 4] do not match the
length of object [1]
after executing the
Öhagen Patrik Patrik.Ohagen at mpa.se writes:
Dear List,
I was asked to calculate a confidence interval for p*p. Is there any standard
techniques for calculating
such an interval? Delta Method?
Thank you in advance!
if p is a generic value (i.e. not a probability) and you know
A BIG thanks to Luke Tierney and Jim Holtman (and perhaps others? I haven't
seen the latest digest) for pointing out two fixes to some code that was
troubling me. I since found a third problem, and with that, have good code.
Their comments are summarized below this fixed version of the code.
Hi,
In a discussion of factor analysis in Using Multivariate Statistics by
Tabachnick and Fidell, two matrices are singled out as important for
interpreting an exploratory factor analysis (EFA) with an oblique promax
rotation. One is the structure matrix. The structure matrix contains the
As part of my work, I am trying to append matrices onto data frames.
Naively I assumed that when rbinding a data.frame and matrix, the matrix
would be coerced and appended, keeping the names from the data frame.
Clearly, I am not fully understanding the process by which rbind works.
Gregg,
What about
A-data.frame(1,1,1); names(A)=letters[1:3] ; B-matrix(0,2,3)
B-as.data.frame(B)
names(B)-names(A)
rbind(A,B)
-Cody
Gregg Lind
This takes care of things quite nicely. The other solutions (explicitly
coercing things) work as well, but this seems to me the minimum
necessary solution for my particular problem.
(P.s.: I hope I responded in the correct way to ensure threading... to
the main list address.)
A-
I don't know if this is the right way, but I think this would work
(I'm assuming you want the result to be a data frame):
data.frame(rbind(as.matrix(A),B))
You might get a warning about row names, but I think it works OK.
On 05/03/07, Gregg Lind [EMAIL PROTECTED] wrote:
As part of my work, I
Hi.
I am aware of three different R packages for linear programming: glpk,
linprog, lpSolve. From what I can tell, if there are N variables and M
constraints, all these solvers require the full NxM constraint matrix. Some
linear solvers I know of (not in R) have a sparse matrix input format.
R Experts:
I am conducting a meta-analysis where the effect measures to be pooled
are simple proportions. For example, consider this data from
Fleiss/Levin/Paik's Statistical methods for rates and proportions (2003,
p189) on smokers:
Study N Event P(Event)
1 86 83
does anyone have any tips for using the tm package for supporting
autoclassifying textual documents? while tm works very well for
parsing text documents and creating term-document matrices, it doesnt
seem to support tracking document classes by default. without a way to
know the classes of your
On Mar 3, 2007, at 3:19 PM, Deepayan Sarkar wrote:
On 3/3/07, Michael Kubovy [EMAIL PROTECTED] wrote:
Dear r-helpers,
I'm conditioning an xyplot on a variable whose levels are'low',
'med', 'high'. How do I override the alphabetical ordering for the
panels of the plot?
This has less to
If you can reformulate your LP as an L1 problem, which is known to be
possible without loss of generality, but perhaps not without loss of
sleep,
then you could use the sparse quantile regression functions in the
quantreg package.
url:www.econ.uiuc.edu/~rogerRoger Koenker
check fseris library.
On 3/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi R-helpers,
I'm new to time series modelling, but my requirement seems to fall just
outside the capabilities of the arima function in R. I'd like to fit an
ARMA model where the variance of the disturbances is a
I have an interesting lme - problem. The data is part of the Master
Thesis of my friend, and she had some problems analysing this data,
until one of her Jurors proposed to use linear mixed-effect models. I'm
trying to help her since she has no experience with R. I'm very used to
R but have very
I've had no response to the enquiry below, so I made a rather half-baked
version in grid -- code and pdf are available here:
http://www.econ.uiuc.edu/~roger/research/ncaa
comments would be welcome. This is _the_ ubiquitous graphic this
time of
year in the US, so R should take a
Thank you for the tip. Can quantreg actually handle mixed / integer
programs?
-- TMK --
212-460-5430home
917-656-5351cell
- Original Message -
From: roger koenker [EMAIL PROTECTED]
To: Talbot Katz [EMAIL PROTECTED]
Cc: r-help R-help@stat.math.ethz.ch
Sent: Monday, March 05,
R-Experts:
I just realized that the example I used in my previous posting today is
incorrect because it is a binary response, not a multilevel response
(small, medium, large) such as my real life problem has. I apologize
for the confusion. The example is incorrect, but the multinomial
On 3/5/07, Michael Kubovy [EMAIL PROTECTED] wrote:
Unless one makes the factor ordered, reordering the levels of a
factor does not seem to be a trivial matter. The only R function I've
found that makes it easy is reorder_factor() (package:reshape). Or am
I missing something?
Don't think in
Hi there,
I'm writing a function that calculates the probability of different
outcomes of dice rolls (e.g., the sum of the highest three rolls of
five six-sided dice). I'm using the combinations function from the
gtools package, which is great: it gives me a matrix with all of the
possible
Hi
jim holtman wrote:
What is wrong with the method that you have? It looks reasonable
Actually there is nothing wrong with the approach I am using - it just
seemed to be quite complicated and I assumed that there is an easier
approach around.
The dataset is not that large that I really have
Hi Chris
Chris Stubben wrote:
Finally I would like to have a data.frame t2 which only contains the
entries of the last measurements.
You could also use aggregate to get the max year per plate then join that back
to the original dataframe using merge on year and plate (common columns in
is this what you mean?
tmp - combinations(3, 3, rep=TRUE)
colSums(apply(tmp, 1, duplicated))+1
b
On Mar 6, 2007, at 1:16 AM, Dylan Arena wrote:
Hi there,
I'm writing a function that calculates the probability of different
outcomes of dice rolls (e.g., the sum of the highest three rolls of
sorry, i forgot to mention that you will need an extra test |-)
tmp - combinations(3, 3, rep=TRUE)
out - colSums(apply(tmp, 1, duplicated))+1
out[out == 1] - 0
but now, re-reading your message, you say
(..) want to count the number of times each element appears in each
arrangement (...)
Dears:
I have a question about multiple response and find the optima setting.
There are 7 responses(y1,y2,y3,y4,y5,y7,y8) and 5 variables(x1-x5).
y1=0.3567+ 0.0154*x1-0.0003*x2+ 0.2295*x3-0.0082*x4
y2=278.6814-4.3832*x1+0.0831*x2-24.3953*x3+8.1404*x4
y3=8.9813-0.0025*x2-0.1746*x3+ 0.0560*x4+
I mean something like in MATLAB matrix(sel_r,:)=[]
jastar wrote:
Hi,
I'm working with a big square matrix (15k x 15k) and I have some trouble.
I want to delete selecting rows and columns.
I'm using something like this:
sel_r=c(15,34,384,985,4302,6213)
79 matches
Mail list logo