[R-sig-ME] Presenting results of a mixed model containing factors

Ben Bolker bbolker at gmail.com
Sun Sep 8 23:47:05 CEST 2013


Sarah Dryhurst <s.dryhurst at ...> writes:

> 
> I am running a mixed effects model using the following code:
> 
> m1<- lmer(DV~TMT*TMT2+(1|Block/TMT1),verbose=T)
> 
> An example dataset is here: http://pastebin.com/bHug5kTt
> 
> The two explanatory variables are both factors with two levels
> (treatment and control).  Treatment 2 is split within Treatment 1
> which is in turn within block.
> 
> The model output I get is as follows (sorry for the formatting!)
> 
> Linear mixed model fit by REML
> 
> Formula: Richness ~ NT * WT + (1 | Block/WT)
>    Data: rich2013
>            AIC     BIC    logLik    deviance   REMLdev
>            93.04  101.3  -39.52    81.87        79.04
> 
> Random effects:
>  Groups   Name        Variance   Std.Dev.
>  WT:Block (Intercept) 3.3667e+00 1.8348e+00
>  Block    (Intercept) 8.2334e-19 9.0738e-10
>  Residual             6.1667e-01 7.8528e-01
> Number of obs: 24, groups: WT:Block, 12; Block, 6

  Note here that your among-block variance is effectively zero ...

> Fixed effects:
>                  Estimate   Std. Error        t value
> (Intercept)  12.0000     0.8148          14.728
> NTNX         -0.5000     0.4534           -1.103
> WTS          -3.6667     1.1523           -3.182
> NTNX:WTS  3.3333     0.6412            5.199
> 
> Correlation of Fixed Effects:
>                  (Intr)      NTNX     WTS
> NTNX          -0.278
> WTS           -0.707   0.197
> NTNX:WTS  0.197    -0.707  -0.278
> 
> I have a few questions - i'm sorry if this is not the right place to
> ask them (they are quite simple!):
> 
> In interpreting this model, am I correct in thinking that the output I
> get tells me the effect of one level of each factor compared with the
> other level of that factor, and also the effect of the interaction in
> terms of the effect of one combination of treatments compared to
> another combination of treatments?

  As is generally true in R modeling (with the default treatment
contrasts), the main effects represent the difference between the
treatment and the control at the baseline level of the other effect.
The interaction represents the difference between the double-treatment
effect and the combined (additive) effect of the two treatments.

> My main concern lies in how to report this model in a paper or thesis.
>  It seems to be common practice to the "main effect" of each factor in
> a model (and perhaps the main effect of an interaction?), and then to
> discuss the difference between factor levels later.  Is this correct?
> 
> If the above is correct, in an lm, I would simple use
> summary.aov(model) to give me the summary of the main effects of each
> explanatory factor and the interaction and report these, along with
> their test statistic and p value (subjective, I know).  However I do
> not know how to do this in lme4, or indeed if this is even a correct
> approach.

> 
> Specifically then, I am wondering:
> a) Is the extraction of these "main effects" possible in lme4 and if
> so, how is it done?

  The "main effects" are the effects you see, but they have to
be interpreted carefully.

> b) How best to present the results of the two treatments...
> c) How best to present the results of the interaction between the two
> treatments at all levels of this interaction (so for all combinations
> of factor levels that make up the 2x2 factorial experiment).
> 
> I have struggled to find much information relating to how to present
> such models online...

   Most of these questions aren't specific to lme4, it's just that
the standard suite of answers get more complicated in _any_ situation
(glm(), lmer(), etc.) where there isn't a simple, unique additive 
decomposition of effects.  There is a fair amount of controversy
even about how to handle main effects in the presence of interactions
(the "SAS type III SSQ/marginality" argument): e.g. google for
"venables exegeses linear models".

  There is a strong effect of the interaction in your case.
If you want to get 'average' effects of the main effects, which
may or may not make sense, you can use sum-to-zero contrasts.

  Ben Bolker



More information about the R-sig-mixed-models mailing list