Skip to content
Prev 4284 / 20628 Next

longitudinal with 2 time points

Hi John,

If there are only two time points per subject I think model 2 should  
throw an error because the residual variance and (time|Subject)  
(co)variances cannot be uniquely estimated. You can get around this  
problem  by moving the (time|Subject) term into the residual term and  
dropping it from the random terms using MCMCglmm or ASReml:

MCMCglmm(y ~ treatment + gender + age + time, rcov=~  
us(as.factor(time)):subject,  ...

This route was also suggested by Ben Bolker and John Maindonald for  
coping with negative variances.


However, when I try:

set.seed(1)
subject<-gl(50,2)
time<-gl(2,1,100)
y<-rnorm(100)
summary(lmer(y~time+(time|subject)))

I get estimates of all terms and so may be they can be uniquely  
estimated (although it would surprise me a lot)?

Jarrod
On 12 Aug 2010, at 06:33, array chip wrote: