Let’s use the exact same toy example from the previous chapter, but let’s convert it to a repeated measures design.
Last time, we imagined we had some data in three groups, A, B, and C. The data looked like this:
scores <- c(20,11,2,6,2,7,2,11,2) groups <- as.character(rep(c("A","B","C"), each=3)) df<-data.frame(groups,scores) knitr::kable(df)
The above table represents a between-subject design where each score involves a unique subject.
Let’s change things up a tiny bit, and imagine we only had 3 subjects in total in the experiment. And, that each subject contributed data to the three levels of the independent variable, A, B, and C. Before we called the IV
groups, because there were different groups of subjects. Let’s change that to
conditions, because now the same group of subjects participates in all three conditions. Here’s the new table for a within-subjects (repeated measures) version of this experiment:
scores <- c(20,11,2,6,2,7,2,11,2) conditions <- as.character(rep(c("A","B","C"), each=3)) subjects <-rep(1:3,3) df<-data.frame(subjects,conditions,scores) knitr::kable(df)