[R] simulate data for lme

melanie.r queen_of_pain05 at gmx.net
Tue Jul 8 17:36:27 CEST 2008


hi.
i did some research first, but didn't find what i was looking for...

the thing is:
i generated data with correlated errors and simulated the power with using
aov(). what i wanna do now is something similar while using lme(), so that
the corr-structure will be paid attention to.
i'm not quite sure how to do that...

i hope someone can help me.
thanks in advance.

mel


code:

ee<-mvrnorm(n=100, mu=rep(0,N),Omega.block) 
#omega.block describes the corr-structure
mu<-c(1,2,3)
(group<-factor(rep(1:k,n)))
eval.simu<-function(e)	
{
y<-mu[group]+e
fit<-aov(y~group)
s.fit<-summary(fit)[[1]]
s.fit$P[1]
}
p<-apply(ee,1,"eval.simu")
#then count number of p≤alpha to get power
-- 
View this message in context: http://www.nabble.com/simulate-data-for-lme-tp18342119p18342119.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list