[R] simulate data for lme

From: melanie.r <queen_of_pain05_at_gmx.net>
Date: Tue, 08 Jul 2008 08:36:27 -0700 (PDT)

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.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 08 Jul 2008 - 15:56:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jul 2008 - 16:32:05 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive