Dear Jakke,<br><br>my answers are inserted below.<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Imagine a 2 x 3 factorial design, with Factor A having two levels (A1 and<br>


A2) and Factor B having three levels (B1, B2, B3). The dependent variable is<br>
reaction time (logRT).<br>
<br>
If I&#39;m interested in the main effects of A and B, I run the following:<br>
<br>
lmer(logRT~A+B+(1|Subject)+(1|Item), data)<br>
<br>
This would give me something along these lines:<br>
<br>
Fixed effects:<br>
             Estimate Std. Error t value<br>
(Intercept)  6.286297   0.023018  273.11<br>
A2               0.007858   0.004204    1.87<br>
B2          -0.017007   0.003689   -4.61<br>
B3          -0.012179   0.003700   -3.29<br>
<br>
If I understand correctly, the model here is evaluating A2 against A1, B2<br>
against B1, and B3 against B1. This leads me to my first question: Is there<br>
any way to find out if the main effect of B is significant?</blockquote><div><br>Do I understand correctly that you want an omnibus test assessing whether B contributes significant information to the model? Is that what you mean by the &quot;main effect&quot; of B? If so, you need to do model comparison of this model against a model without B. Fit both models with method=&quot;ML&quot; (see Baayen et al., 2008-JML for elaboration). Though I think if you create the two models and use anova() to compare them, anova() does the right thing anyway. <br>

<br>so<br><br>l &lt;- lmer(logRT~A+B+(1|Subject)+(1| Item), data) <br>l.woB &lt;- lmer(logRT~A+(1|Subject)+(1| Item), data)<br><br>anova(l, l.woB)<br><br>should do the job. Note that I would also at least test whether random slopes for A+B.<br>

<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Moving on with the same example, assume that I&#39;m also interested in the<br>
interaction between A and B. Specifically, I want to find out whether the<br>
effect of A differs at the three levels of B. I run the following model:<br>
<br>
lmer(logRT~A*B+(1|Subject)+(1|Item), data)<br>
<br>
which would give me something like this:<br>
<br>
Fixed effects:<br>
                  Estimate Std. Error t value<br>
(Intercept)       6.286656   0.023133  271.76<br>
A2              0.007149   0.006009    1.19<br>
B2               -0.013616   0.005211   -2.61<br>
B3               -0.016637   0.005225   -3.18<br>
A2:B2        -0.006842   0.007377   -0.93<br>
A2:B3         0.008973   0.007395    1.21<br>
<br>
These are really hard tables to interpret. I believe we are now seeing the<br>
difference between A1 and A2 at B1 (0.007149). Furthermore, the last two<br>
lines tell us that at B2 the difference needs to be adjusted by -0.006842,<br>
and at B3 it needs to be adjusted by 0.008973, and that these adjustments<br>
are non-significant. This model doesn&#39;t provide information about the main<br>
effects.</blockquote><div><br>Be cautious with the interpretation of A and B&#39;s contrast
coefficients since there may be collinearity in the model (especially
when you include the interaction of A and B). Have you checked the fixed effect correlations? I recommend reading Baayen et al., 2008 and maybe browse through Baayen&#39;s book. Also, check out Victor Kuperman and my slides for WOMM (<a href="http://hlplab.wordpress.com/2009-pre-cuny-workshop-on-ordinary-and-multilevel-models-womm/">http://hlplab.wordpress.com/2009-pre-cuny-workshop-on-ordinary-and-multilevel-models-womm/</a>). These slides cover what you need to do about collinearity (as well as what that is to begin with ;).<br>

<br> 
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> If I wanted to report these, would I refer back to the first model?</blockquote>

<div><br>You report everything from the last model. If you use treatment coding of factors (R default) then what you called main effects actually are not main effects. They are simple effects. To get main effects as in ANOVAs, you should contrast code (contrast.sum()) the factors. There are some commented R scripts on coding on our lab wiki (<a href="http://wiki.bcs.rochester.edu:2525/HlpLab/StatsCourses/HLPMiniCourse">http://wiki.bcs.rochester.edu:2525/HlpLab/StatsCourses/HLPMiniCourse</a>). Conveniently, contrast-coding with also deal with collinearity between main effects and interactions if you have balanced data.<br>

<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
And my third question: when we do ANOVAs, we&#39;re told to first see if the<br>
interaction between A and B is significant, and only then look at the<br>
interaction contrasts. Lmer in the above table gives you (some of) the<br>
contrasts, but doesn&#39;t evaluate the interaction as a whole. Do we still need<br>
to worry about the interaction as a whole, and if yes, how would we evaluate<br>
it?</blockquote><div><br>If you want to follow ANOVA logic, do model comparison. start with the full model and then do stepwise removal. For a balanced data set, this procedure basically brings you back to ANOVA-land ;) -- while still taking advantage of mixed models (relaxed assumptions, etc.). So, start with a full model:<br>

<br>1) l &lt;- lmer(logRT~A*B+(1+A*B|Subject)+(1+A*B| Item), data) <br>2) follow the procedure outline on our lab blog to figure out which random effects you need: <a href="http://hlplab.wordpress.com/2009/05/14/random-effect-should-i-stay-or-should-i-go/">http://hlplab.wordpress.com/2009/05/14/random-effect-should-i-stay-or-should-i-go/</a><br>

3) take the resulting model and compare it against a model without the interaction, using anova(l, l.woInteraction).<br>4) <i>if removal of the interaction is not significant</i>, you could further compare the model against a model with only A (see above).<br>

5) Interpret coefficients in the full model or in the reduced model (I would do the former unless I don&#39;t have much data or cannot reduce collinearity, but you may prefer the latter).<br>6) If you find any of the scripts of references given above useful, cite/refer to them, so that others can find them ;)<br>

<br>HTH,<br>Florian<br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Many thanks in advance!<br>
<br>
Jakke<br>
<br>
<br>
_______________________________________________<br>
R-lang mailing list<br>
<a href="mailto:R-lang@ling.ucsd.edu">R-lang@ling.ucsd.edu</a><br>
<a href="http://pidgin.ucsd.edu/mailman/listinfo/r-lang" target="_blank">http://pidgin.ucsd.edu/mailman/listinfo/r-lang</a><br>
</blockquote></div><br>