Mixed effects models#

The question and the claim#

Mixed models represent variation across sampling units and partially pool their estimates. The random-effects structure should follow the design and scientific target. Prediction for a new participant differs from prediction for another observation of a known participant.

What you should be able to do#

  • Specify the scientific target and the observations needed to address it.

  • Justify grouping factors and random slopes, inspect singularity and convergence, and state whether prediction targets known or new groups.

  • Explain the assumptions, uncertainty, and limits of your conclusion.

Worked investigation#

Compare pooled and mixed models in sleepstudy, then fit crossed participant/item intercepts to lexical-decision trials. The worked notebook is self-contained and uses documented teaching data. Its output is evidence about that example, not a finding about a human population.

Challenge the result#

Variance components can be zero; nonnegativity does not imply significance. Ignoring clustering can invalidate standard errors without necessarily biasing a fixed-effect point estimate. Before running an analysis, predict what this failure would change. After running it, distinguish a software check from a scientific justification.

Practice and verification#

Complete the exercise, then discuss the interpretation questions. Submit a runnable notebook, your assumptions, and a short evidence-based interpretation. The shared analysis workflow defines the reporting and assessment standard.

For AI assistance, first write your own target and expected behavior. Use generated suggestions as candidates, inspect the code or claims, and retain evidence of the checks you performed. The AI analysis guide includes a saved-output activity that requires no account or paid service.

Connection across lessons#

Connect trial dependence to the observational unit and use it to choose the validation split.

Earlier lecture resources#

The recordings and slides below are retained from the earlier course edition and have not been revised. Use the written chapter, revised notebook, and exercise for current definitions and procedures; earlier examples may conflict with the corrections described here.

Required readings#

Bates, Douglas M. “lme4: Mixed-effects modeling with R.” (2010): 470-474.

Yarkoni, T. (2022). The generalizability crisis. Behavioral and Brain Sciences, 45, e1.

Lecture (Video)#

Mixed effects models

Slides (PDF)#

Mixed effects models