Maho Takahashi

Linguistics PhD Student at UC San Diego

research

CV

code

mtakahas[at]ucsd[dot]edu

How to check for counterbalancing

data <- read.csv('./sampledata.csv')
head(data, 3)
##   Movement Island_Type Island Distance Item
## 1       WH         whe    non       sh    1
## 2       WH         whe    non       sh    2
## 3       WH         whe    non       sh    3
##                                   Sentence Subj_id List Score
## 1 Who thinks that Paul stole the necklace?       1    1     6
## 2     Who thinks that Matt chased the bus?       1    1     2
## 3 Who thinks that Tom sold the television?       1    1     3

At a point in data analysis, it’s necessary to make sure that an equal number of participants is assigned to each list. The code below gives you the information.

data %>% group_by(List) %>% summarize(num = length(unique(Subj_id)))
## # A tibble: 4 × 2
##    List   num
##   <int> <int>
## 1     1     4
## 2     2     4
## 3     3     4
## 4     4     4