[R] within-subject factors in lme

lorenz.gygax at art.admin.ch lorenz.gygax at art.admin.ch
Wed Aug 22 16:40:27 CEST 2007

> > If I understand correctly, you want to include the interactions  
> > between the random and fixed terms?
> Yes that is exactly I wanted to model.
> > This is done like:
> >
> > model.lme <- lme(Beta ~ Trust*Sex*Freq,
> >                  random = ~Trust*Sex*Freq|Subj, Model)
> >
> > But this needs a lot of observations as quite a few 
> > parameters need to be estimated!
> Well, I tried this as well, but it seems R kept hanging there and  
> never finished the modeling. It is very likely due to some  
> singularity as you suspected about the large number of parameters  
> needed to estimate. But this is not a problem with aov. So does
> it mean that I can't run a similar model to that in aov with lme?

It depends what you mean by 'similar'. You could still include some of the interactions, e.g. by random = ~(Trust+Sex+Freq)^2|Subj, or even further reduced such as ~Trust+Sex+Freq|Subj. I am not very familiar with aov, but I would suspect that the model you calcualted in aov is not really the same than the one with all possible interactions in lme. In any case, I would personally trust lme much more than aov.

> but I feel this is not good enough to account for cross-subject  
> variations for those interactions. Why wouldn't those patterned  
> variance-covariance matrix specifications work as I mentioned in
> my previous mail? Any more thoughts and suggestions?

Sorry, I have never really worked with those.

Lorenz Gygax
Centre for proper housing of ruminants and pigs
Agroscope Reckenholz-Tänikon Research Station ART

More information about the R-help mailing list