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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Doug Davidson <dvdsn at printhost.beckman.uiuc.edu> writes:> With lme, is there a way to specify multiple fixed factors under one > level of grouping?I'm not sure I understand the question. Can you tell us more about the model that you want to fit? If you mean that you want a random interaction term then you might want to check the description in section 1.3 of Pinheiro and Bates (Springer, 2000) on different ways that interactions can be expressed in lme.> 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)-- Douglas Bates bates at stat.wisc.edu Statistics Department 608/262-2598 University of Wisconsin - Madison http://www.stat.wisc.edu/~bates/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._