Skip to content

Presenting results of a mixed model containing factors

9 messages · Ben Bolker, Henrik Singmann, Sarah Dryhurst

#
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


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?

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?
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...

Many thanks in advance!

Sarah
2 days later
#
Sarah Dryhurst <s.dryhurst at ...> writes:
Note here that your among-block variance is effectively zero ...
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.
The "main effects" are the effects you see, but they have to
be interpreted carefully.
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
#
Hi Ben,

Thank you for your reply!  I don't really want to calculate the main
effects as it doesn't make much biological sense (to me!).  I just
wasn't sure whether this was "required" in terms of statistical
reporting.  That interaction effect is what I am interested in
largely, as it's the combined effect of the different treatments that
is my focus.

With regards to the lack of variance at the Block level, would you
recommend dropping this level here?  It doesn't seem to make too much
sense to keep it there...

Thank you once again

Sarah
On Sun, Sep 8, 2013 at 10:47 PM, Ben Bolker <bbolker at gmail.com> wrote:

  
    
#
Sarah Dryhurst <s.dryhurst at ...> writes:
I think it would still be worth reporting the main effects, as
their size puts the size of the interaction in perspective (e.g. I
would generally like to be able to judge the size of the interaction
*relative to* the main effects, not just its magnitude/t statistic/
p value ...
Doesn't matter too much, since the results will be almost identical.
May be worth checking without, to double-check that the zero-variance
result hasn't thrown off the optimization, but I would personally
probably err on the side of reporting it (or say that it was in 
the original model but estimated as being effectively zero).
8 days later
#
Hi Sarah,

One way to globally set sum to zero contrasts is by setting the contrasts via options:
options(contrasts=c('contr.sum', 'contr.poly'))

This is automatically done when loading afex which also provides you with the overall effect you are interested in (using the Kenward-Rogers approximation):

require(afex)

dat <- read.table("http://pastebin.com/raw.php?i=bHug5kTt", header = TRUE)

mixed(DV~TMT1*TMT2+(1|Block/TMT1), dat)

##        Effect     stat ndf ddf F.scaling p.value
## 1 (Intercept) 377.3464   1   5         1  0.0000
## 2        TMT1   3.2653   1   5         1  0.1306
## 3        TMT2  13.2433   1  10         1  0.0045
## 4   TMT1:TMT2  27.0271   1  10         1  0.0004


Alternatively you can get the same results from car::Anova:

Anova(m1)
## Analysis of Deviance Table (Type II Wald chisquare tests)
##
## Response: DV
##             Chisq Df Pr(>Chisq)
## TMT1       3.2653  1  0.0707600 .
## TMT2      13.2433  1  0.0002736 ***
## TMT1:TMT2 27.0271  1  2.006e-07 ***
## ---
## Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

As your design is fully balanced this is equivalent to type three tests (the default for afex):
Anova(m1, type = 3)

Hope that helps.

Cheers,
Henrik


Am 18.09.2013 18:20, schrieb Sarah Dryhurst:

  
    
#
Am 18.09.2013 19:29, schrieb Sarah Dryhurst:
Yes.