[R] lme and mixed effects

Doug Davidson dvdsn at printhost.beckman.uiuc.edu
Tue Jan 22 15:16:46 CET 2002


Dear r-help,

With lme, is there a way to specify multiple fixed factors under one level of grouping?

For example, for a single fixed factor, I use the following:

fm1.lme <- lme(fixed=resp ~ fact1, random=~1|subj/fact1, data=mydata) 


I would like to have multiple factors under subj, like the following
for a two-way design, but I get an error:


fm2.lme <- lme(fixed=resp ~ fact1*fact2, random=~1|subj/(fact1+fact2), data=mydata) 

Error in getGroups.data.frame(dataMix, groups): 
      Invalid formula for groups


I get the same error when I try to construct a groupedData object with
the above two-factor formula. Generally, I am trying to write something analogous to the following in aov:

fm2.aov <- aov(resp ~ fact1*fact2 + Error(subj/(fact1+fact2)), data=mydata)



Many thanks.

-Doug

Doug Davidson/2143 Beckman Institute/dvdsn at casper.beckman.uiuc.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list