Introduction to mixed-effects modelling

Christophe Pallier
2017-05-29

Plan

  • Some generalities about statistical inference
  • Classic regression and its implementation in R
  • Random effects and mixed-effects models
  • Examples of mixed-effects analyses with R

Meaning of "X has an effect on Y" mean

What does it mean, from a statistical point of view, to say that the variable X has an effect on the variable Y?

Y is influenced by X if the *distribution of Y change when X takes different values.

Example

plot of chunk unnamed-chunk-1

As the two distributions differ, we can state that “X has an effect on Y”“ (not implying causality).

Remark: One is often only interested in whether the means of the distributions differ, e.g.: E(Y|X=1)?=E(Y|X=2)

Comparing with a model with Trial as a random effect within Subject

m2 <- lmer(RT ~ Frequency + Length + NativeLanguage + cTrial + (1 + cTrial | Subject) + (1 | Word), data=lexdec3 )
anova(m1, m2)
Data: lexdec3
Models:
object: RT ~ Frequency + Length + NativeLanguage + cTrial + (1 | Subject) + 
object:     (1 | Word)
..1: RT ~ Frequency + Length + NativeLanguage + cTrial + (1 + cTrial | 
..1:     Subject) + (1 | Word)
       Df     AIC     BIC logLik deviance  Chisq Chi Df Pr(>Chisq)    
object  8 -1311.2 -1268.4 663.59  -1327.2                             
..1    10 -1341.8 -1288.3 680.92  -1361.8 34.651      2  2.991e-08 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

See Baayen (2006, section 7.1 for more detailed analysis)

Difficulties

Specifying the model, especially selecting the random effect structure can be difficult.

In classical ANOVA/hypothesis testing framework, one specifies the maximally complex model and consult the p-values. The model is often overfitting and lacks robustness. For prediction, a model leaving higher order interactions will typically perform better. But model selection is complicated and Psychologist usually avoid it.

  • Barr, D. J., Levy, R., Scheepers, C., and Tily, H. J. (2013). Random effects structure for confirma- tory hypothesis testing: Keep it maximal. Journal of Memory and Language, 68(3):255–278.

  • Bates, Douglas, Reinhold Kliegl, Shravan Vasishth, and Harald Baayen. 2015. “Parsimonious Mixed Models.” arXiv Preprint arXiv:1506.04967. http://arxiv.org/abs/1506.04967.

Books on mixed-effects

  • R. H. Baayen (2008) Analyzing linguistic data. A practical introduction to Statistics using R, Cambridge University Press.
  • N. W. Galwey (2006) Introduction to Mixed Modelling: Beyond Regression and Analysis of Variance, John Wiley & Sons.
  • Andrew Gelman and Jennifer Hill (2007). Data Analysis Using Regression and Multilevel/Hierachical Models. Cambridge University Press.