An introduction to repeated measures

Hierarchical and Mixed Effects Models in R

Richard Erickson

Data Scientist

Repeated measures

  • Follow same unit of study through time
  • e.g., cohort of students, individuals
  • More powerful because of individual-level variability observed
Hierarchical and Mixed Effects Models in R

Paired t-test

  • Special case of a t-test
  • Example of change in test scores pre- and post-intervention
  • Nice conceptual introduction to repeated measures
Hierarchical and Mixed Effects Models in R

Paired t-test in R

t.test(x1, x2, paired = TRUE)
Hierarchical and Mixed Effects Models in R

Repeated measures ANOVA

  • Conceptual extension of paired t-test
  • Tests if means are constant across time
  • Example of change in student test-scores with >2 tests
Hierarchical and Mixed Effects Models in R

Repeated measures in R

library(lmerTest)

anova(lmer(y ~ time + (1 | individual))
Hierarchical and Mixed Effects Models in R

Extension to lmer and glmer

  • Repeated measures a special type of mixed-effect
  • Can be applied to glmer as well
  • Powerful additional use of tool
  • Degrees of freedom is an open research method
Hierarchical and Mixed Effects Models in R

Let's practice!

Hierarchical and Mixed Effects Models in R

Preparing Video For Download...