[R-sig-ME] within subjects, 3 conditions, 3 lines
Stanislav Aggerwal
stan.aggerwal at gmail.com
Wed Jan 21 09:16:06 CET 2015
I will attempt an answer to my own question. Possibly the reason I got the
same answer with the 3 methods is that my simulation was wrong. It
simulated the responses as:
y<- (cond=="a")*(a1 + a4*x) + (cond=="b")*(a1+a2 + (a4+a5)*x) +
(cond=="c")*(a1+a3 + (a4+a6)*x) + rnorm(5*3*nsubj,mean=0,sd=.5)
This contains the intercepts and slopes which are unique to each subject
and randomly sampled from some population values. However the term:
rnorm(5*3*nsubj,mean=0,sd=.5)
is wrong because it says the errors are independent. Instead they should be
correlated within each subject.
I will give that a go.
Stan
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list