Skip to main content
Logo image

Answering Questions with Data Introductory Statistics for Psychology Students

Section 8.1 Repeated measures design

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, such as in Table 8.1.2:

Remark 8.1.1. R Code.

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)
Table 8.1.2. Example data for three groups.
groups scores
A 20
A 11
A 2
B 6
B 2
B 7
C 2
C 11
C 2
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. Table 8.1.4 shows a within-subjects (repeated measures) version of this experiment:

Remark 8.1.3. R Code.

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)
Table 8.1.4. Example data for a repeated measures design with three conditions, where each subject contributes data in each condition.
subjects conditions scores
1 A 20
2 A 11
3 A 2
1 B 6
2 B 2
3 B 7
1 C 2
2 C 11
3 C 2