LMM analysis workflow

You do not need to memorise these steps. This page is here so you can refer to it while working through LMM analyses for your DAPR reports, minidissertations, and dissertations.

You won’t need to use every step below for every analysis, and they don’t need to be in this specific order either. This is just the order Elizabeth usually uses 😊

Think of these steps like a buffet to pick and choose from, depending on what your analysis needs.

Phase 0: Before collecting data (if applicable)

  • Run a power analysis to see how many people you’ll need to gather data from, given the effect size you expect to see or the smallest effect size that’s still theoretically interesting.

Phase 1: Before model fitting

1a: Set up your code and data

  • Load the required R packages. You’ll probably need at least:
    • tidyverse (for managing and wrangling data)
    • lme4 (for fitting LMMs)
    • lmerTest (for displaying p-values for the fixed effect coefficients)
    • stats (for xtabs(), useful for identifying possible random slopes)
    • HLMdiag (for computing influence diagnostics)
    • effects (for plotting model-fitted values)
  • Read in your data.
  • Tidy data (e.g., any missingness, any implausible values? are data types set correctly?).

1b: Set up the fixed effects

1c: Set up the random effects

Phase 2: Model fitting and troubleshooting

Phase 3: After model fitting

3a: Check assumptions and diagnostics

3b: Plot and interpret model estimates

3c: Write up methods and results