[R] covariance matrix: a erro and simple mixed model question, but id not know answer sorry

2011-04-17 Thread Maya Joshi
Dear list I need your help: Execuse me for my limited R knowledge. #example data set set.seed (134) lm=c(1:4) block = c(rep(lm,6)) gen <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4),rep(5, 4),rep(6, 4)) X1 = c( rnorm (4, 10, 4), rnorm (4, 12, 6), rnorm (4, 10, 7),rnorm (4, 5, 2), rnorm (4, 8,

Re: [R] covariance matrix: a erro and simple mixed model question, but id not know answer sorry

2011-04-18 Thread Maya Joshi
var(x1) var(x2) cov(x1x2) I need to do posterior analysis out of this table Thanks in advance Maya On Sun, Apr 17, 2011 at 9:59 PM, Maya Joshi wrote: > Dear list > > I need your help: Execuse me for my limited R knowledge. > > #example data set > set

[R] problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome

2011-09-02 Thread Maya Joshi
Dear R experts. I might be missing something obvious. I have been trying to fix this problem for some weeks. Please help. #data ped <- c(rep(1, 4), rep(2, 3), rep(3, 3)) y <- rnorm(10, 8, 2) # variable set 1 M1a <- sample (c(1, 2,3), 10, replace= T) M1b <- sample (c(1, 2,3), 10, replace= T) M1aP

Re: [R] problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome

2011-09-03 Thread Maya Joshi
Dear R experts: Thank you Dennis and David ... As David indicated sorry of language and I have tried to explain what I intend to do... I would this with Dennis's solution code: ped <- rep(1:3, c(4, 3, 3)) > y <- rnorm(10, 8, 2) > # This replaces all of your sample() statements, and is equivalen

Re: [R] problem in applying function in data subset (with a level) - using plyr or other alternative are also welcome

2011-09-03 Thread Maya Joshi
owing result seems to pool at X1, X2, and X3 require(plyr) dfsumd1 <- ddply(qtd,.(qtd$ped),myfun2) qtd$ped V1 1 1 0.2296159 2 2 0.1045569 3 3 -5.8861942 But I need a twoway table PedX1X2 X3 1 2 3 Still unsuccessful, sorry ! On Sat, Sep 3, 2011 at 7: