[R] another ANOVA/LM question

Jan Wiener jan.wiener at tuebingen.mpg.de
Wed Oct 26 14:32:59 CEST 2005


Sorry for posting a possibly stupid question.

I am using aov() for calculating ANOVA as follows:

summary(aov(depVar~factor1*factor2+Error(subject/(factor1+factor2)), 
data=anovaAllData))

and usually all works fine.

How exactly the call has to look if I want to use lm() directly to 
obtain the same results.

The problem is that due to several reasons I am missing single data 
points such that I end up with an unbalanced design. From earlier 
posting I learned that lm() is the way to go in such cases.

However, I do not know how exactly the formula  including the error term 
has to look like for lm().

Hope that made sense,

Thanks in advance,
Jan




More information about the R-help mailing list