LMMs: Practice analysis


Data Analysis for Psychology in R 3

Elizabeth Pankratz (elizabeth.pankratz@ed.ac.uk)


Department of Psychology
University of Edinburgh
2026–2027

Course Overview


Linear mixed models
(with Dr. Elizabeth Pankratz)
Regression refresher, intro to group-structured data
Modelling group-structured data using random effects
Interpreting LMMs and building maximal models
Troubleshooting model fit, checking assumptions + diagnostics
LMMs: Practice analysis
factor analysis
working with multi-item measures
(with Dr. Josiah King)
measurement and dimensionality
exploring underlying constructs (EFA)
testing theoretical models (CFA)
reliability and validity
recap & exam prep

The game plan for this week

The game plan for this week


Lectures:

Together, we’ll work through an LMM analysis from beginning to end (hopefully!).


Labs:

You’ll practice writing up a brief report based on this analysis.

Resource: The LMM analysis workflow



Three phases:

  • Phase 1: Before model fitting
  • Phase 2: Model fitting and troubleshooting
  • Phase 3: After model fitting


I will navigate us through these phases. At each step, you’ll use Wooclap to tell me what I should do.

The RQ


  • We’re looking at emotional dysregulation in children: when children have trouble managing their feelings and emotions.
  • Specifically, we want to find out how emotional dysregulation is affected by children having a strong, regular routine at home.
  • We predict that children with stronger home routines are better at regulating their emotions.
  • It’s also plausible that a family’s socio-economic status (SES) is associated with how well children regulate their emotions. We will control for SES using a proxy variable of whether children attend a state school or a private school.


RQ: Controlling for the type of school that children attend, are children with stronger routines better at regulating their emotions?


The data


Data from: https://uoepsy.github.io/data/crqeds.csv


In the data:

variable description
schoolid School identifier
EDS Emotion Dysregulation Score (range 1 to 6, higher values indicate more dysregulation)
CRQ Childhood Routine Questionnaire Score (range 0 to 7, higher values indicate more routine)
schooltype School type (private / state)

Let’s do it!


Back matter

To do this week


Tasks:


Work on exercises in labs


Complete the weekly quiz

Get support:


Consult the flash cards


Ask questions anonymously on Piazza


We really like seeing you in office hours!