[R-sig-ME] factors with multiple levels
maechler at stat.math.ethz.ch
Mon Feb 16 12:12:16 CET 2009
>>>>> "MY" == Miao-Hsuan Yen <melissayen at gmail.com>
>>>>> on Mon, 16 Feb 2009 17:46:17 +0800 writes:
MY> Dear lmer list I have one within-subject factor with 3
MY> levels (A1 A2 A3). By default, I will get an intercept
MY> for the reference group (A3) and two estimates for A1
MY> and A2 compared to A3. How can I get an estimate for the
MY> main effect of factor A as the traditional ANOVA does?
MY> Is there any function or option that allows me to have
MY> an overall test?
MY> In addition, if I have two within-subject factors (A1 A2
MY> A3 and B1 B2) and their interactions, I will get 2
MY> estimates for factor A, 1 estimate for factor B and 2
MY> estimates for the interaction. A similar question is,
MY> how can I get an estimate for the interaction as the
MY> ANOVA does?
To both questions:
You compare the model *with* the corresponding factor (or interaction)
term with a model *without* the corresponding term.
That is *the* (generalization of the) classical ANOVA,
and works for many kinds of models in S and R via
anova(<model1>, <model2>, ..)
--> the beginning of 'Examples' on help(lmer) aka ?lmer
does exactly do this ..
MY> Thanks a lot.
Martin Maechler, ETH Zurich
MY> Best, Miao-Hsuan Yen
MY> [[alternative HTML version deleted]]
MY> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models