[R-lang] Re: ANOVA type main effects

Levy, Roger rlevy@ucsd.edu
Sat May 14 10:38:44 PDT 2011


On Feb 23, 2011, at 11:42 AM, Xiao He wrote:

> Hi dear r-lang users,
> 
> I have a question about ANOVA type of main effects. From what I've read, one way to obtain the type of main effect one would get with ANOVA is to do model comparisons, like below:
> 
> mod1<-lmer(dv ~ iv1 + iv2 + (1|subject), data)
> mod2 <-lmer(dv ~iv1 + (1|subject), data)
> anova(mod1, mod2).
> 
> A significant difference indicates that the factor iv2 make significant contribution to the model.
> 
> However, I wonder if there are other ways to obtain the same information. Specifically, I have a 2X2 design, I wonder if, after I center the two 2-level factors, the results would be equivalent to ANOVA type of main effects as opposed to simple effects. Thank you in advance!

Hi Xiao,

Much belatedly:

Yes, if your data are perfectly balanced, but you need to include random interactions.  If iv1 and iv2 are centered, then the model

  lmer(dv ~ iv1 * iv2 + (iv1*iv2|subject), data)

should give results essentially like traditional repeated-measures ANOVA.

Best

Roger

--

Roger Levy                      Email: rlevy@ucsd.edu
Assistant Professor             Phone: 858-534-7219
Department of Linguistics       Fax:   858-534-4789
UC San Diego                    Web:   http://idiom.ucsd.edu/~rlevy












More information about the ling-r-lang-L mailing list