[R] vector output loop or function

2011-08-31 Thread Nilaya Sharma
Dear all Sorry for simple question: I want to put the following option into look as number of X is large 1000 variables X1 <- sample(c(1,2, 3, 4),10, replace = T, prob = c(0.4, 0.2, 0.2, 0.2)) cv1 <- round(runif(2, 1, 10)) # X2 is copy of X1 X2 <- X1 # now X2 is different in cv1 random posi

Re: [R] splitting into multiple dataframes and then create a loop to work

2011-08-30 Thread Nilaya Sharma
zopoulos >> wrote: >> >>> You can do this using function lmList() from package nlme, without having >>> to >>> split the data frames, e.g., >>> >>> library(nlme) >>> >>> mlis<- lmList(yvar ~ . - clvar | clvar, data = df)

[R] splitting into multiple dataframes and then create a loop to work

2011-08-29 Thread Nilaya Sharma
Dear All Sorry for this simple question, I could not solve it by spending days. My data looks like this: # data set.seed(1234) clvar <- c( rep(1, 10), rep(2, 10), rep(3, 10), rep(4, 10)) # I have 100 level for this factor var; yvar <- rnorm(40, 10,6); var1 <- rnorm(40, 10,4); var2 <- rnorm(40,

[R] Fwd: simple question

2011-05-04 Thread Nilaya Sharma
Cf) } Cim <- apply(nmat, 1, coffin) I tried hard could get a appropriate way to do the job. Can you help me? NIL -- Forwarded message -- From: Nilaya Sharma Date: Wed, May 4, 2011 at 11:32 AM Subject: simple question To: r-help@r-project.org Dear R experts I have simple question, please

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-16 Thread Nilaya Sharma
0 1 –1 0 0 0 0 0 0 0;* *Run;* On Sat, Apr 16, 2011 at 3:45 AM, peter dalgaard wrote: > > On Apr 16, 2011, at 04:21 , Nilaya Sharma wrote: > > > genetic_evaluation <- read.table(textConnection(" > > sire dam adg > > 1 1 2.24 > > 1 1 1.85 > &g

Re: [R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-15 Thread Nilaya Sharma
My question was how can we estimate effects and define correct model equivalent to SAS code provided. On Fri, Apr 15, 2011 at 10:21 PM, Nilaya Sharma wrote: > Hi R community, > > I am new bird to R and moved recently from SAS. I am no means expert on > either but very curious lear

[R] lme4 problem: model defining and effect estimation ------ question from new bird to R community from SAS community

2011-04-15 Thread Nilaya Sharma
Hi R community, I am new bird to R and moved recently from SAS. I am no means expert on either but very curious learner. So your help crucial for me to learn R. I have already got positive expression. I was trying to fit a mixed model in animal experiment but stuck at simple point. The following