Maho Takahashi

Linguistics PhD

research

CV

code

mtakahas[at]ucsd[dot]edu

How to check for counterbalancing

import pandas as pd
sample = pd.read_csv('./sampledata.csv')
sample.head(3)
Movement Island_Type Island Distance Item Sentence Subj_id List Score
0 WH whe non sh 1 Who thinks that Paul stole the necklace? 1 1 6
1 WH whe non sh 2 Who thinks that Matt chased the bus? 1 1 2
2 WH whe non sh 3 Who thinks that Tom sold the television? 1 1 3

Checking for counterbalancing (i.e., how many participants were assigned to each experimental list) on python is pretty simple - we can use nunique() function.

sample.groupby('List')['Subj_id'].nunique()
List
1    4
2    4
3    4
4    4
Name: Subj_id, dtype: int64

We can see that the counterbalancing was perfect - there are 4 participants in each list.