Skip to content
Prev 12876 / 20628 Next

within subjects, 3 conditions, 3 lines

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