Interactions: Practice analysis


Data Analysis for Psychology in R 2

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


Department of Psychology
University of Edinburgh
2025–2026

Course Overview


Introduction to linear Models Intro to linear regression
Interpreting linear models
Testing individual predictors
Model testing & comparison
Linear model analysis
Analysing Experimental Studies Categorical predictors and dummy coding
Effect coding and manual post-hoc contrasts
Assumptions and diagnostics
Bootstrapping and confidence intervals
Categorical predictors: Practice analysis
Interactions Mean-centering and numeric/categorical interactions
Numeric/numeric interactions
Categorical/categorical interactions
Manual contrast interactions and multiple comparisons
Interactions: Practice analysis
Advanced Topics Power analysis
Binary logistic regression I
Binary logistic regression II
Logistic regression: Practice analysis
Exam prep and course Q&A

Analysis workflow: The final form

Structure of this week’s lectures

A hybrid of Emma’s Block 1 finale and
my Block 2 finale


Based on your feedback from last term, this practice session works well for you when:

  • a pair of you codes live on the big screen (with support from us!):
    • one of you “drives”;
    • one of you “navigates”, keeps track on the printed sample code.
  • you vote in a large group on what analysis step should happen when.
  • you have some time to work out the content of each step yourselves.
  • we ask for your input and ideas for how to do each step.

So that’s what we’ll do :)

Without further ado…


wooclap.com, code IXAMRO

Back matter

This week


Tasks:


Attend your lab and work together on the exercises

Support:


Help each other on the Piazza forum


Complete the weekly quiz

Attend office hours (see Learn page for details)

Appendix

Analysis steps, in three phases (1)

Not every analysis requires every step.

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


(1) Before model fitting:

  • Identify the relevant variables
  • Data tidying (e.g., missingness? factor levels?)
  • Get summary statistics for the relevant variables
  • Plot each relevant variable individually
  • Plot the relevant variables together
  • Set up categorical predictors (e.g., what a priori coding scheme?)
  • Set up continuous predictors (e.g., any transformations?)
  • Decide whether the RQ requires an interaction model
  • Think what the model coefficients might look like
  • Formally state null and alternative hypotheses

Analysis steps, in three phases (2)


(2) Model fitting:

  • Fit the linear model to the data

Analysis steps, in three phases (3)


(3) After model fitting:

  • Check model assumptions
  • Bootstrap the linear model (lost to the strike)
  • Run diagnostics for multicollinearity
  • Run diagnostics for unusual data points (skipped for time)
  • Run sensitivity analysis (skipped for time)
  • Interpret the model estimates
  • Get estimated marginal means
  • Plot estimated marginal means
  • Compute simple slopes/simple effects (incl. corrections for multiple comparisons)
  • Plot simple slopes/simple effects
  • Create and test manual contrasts
  • Create and test interactions between manual contrasts
  • Write up your analysis (in this week’s labs!)