Skip to content
Prev 10708 / 20628 Next

Presenting results of a mixed model containing factors

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: