In a Stroop task, participants are presented with a list of words, with each word displayed in a color of ink. The participant’s task is to say out loud the color of the ink in which the word is printed. The task has two conditions: a congruent words condition, and an incongruent words condition. In the congruent words condition, the words being displayed are color words whose names match the colors in which they are printed: for example RED, BLUE. In the incongruent words condition, the words displayed are color words whose names do not match the colors in which they are printed: for example PURPLE, ORANGE. In each case, we measure the time it takes to name the ink colors in equally-sized lists. Each participant will go through and record a time from each condition
Since the sample size $n < 30$, one sample two tailed t-test (for paired samples) with $\alpha = .05$ is proposed. This will determine whether there is a significant difference in the two samples namely Congruent and Incongruent cases. We don't know the population standard deviation, hence the Bessel corrected standard deviation of the sample should be used.
import csv
import numpy as np
import pandas as pd
from IPython.display import display
import matplotlib.pyplot as plt
%matplotlib inline
data = pd.read_csv('dataset.csv') # read the data
display(data)
Mean and Stand deviation for both cases are given.
For congruent case (n = 24) : $$\overline{x_C} = 14.051\quad \sigma_D = 3.559$$ For incongruent case (n = 24) : $$\overline{x_I}=22.016\quad \sigma_I = 4.797$$
fig=plt.figure(figsize=(7,5.5))
plt.subplot(221)
plt.hist(data["Congruent"], color="#D86E3F")
plt.xlabel('Time Scores for Congruent', fontsize=10)
plt.ylabel('Frequency', fontsize=10)
plt.subplot(222)
plt.hist(data["Incongruent"], color="#2088B2")
plt.xlabel('Time Scores for Incongruent', fontsize=10)
plt.ylabel('Frequency', fontsize=10)
plt.subplot(223)
plt.hist(data["Congruent"], color="#D86E3F",alpha=0.75,
label="Congruent")
plt.hist(data["Incongruent"], color="#2088B2", alpha=0.75,
label="Incongruent")
plt.xlabel('Time Scores', fontsize=10)
plt.ylabel('Frequency', fontsize=10)
fig.tight_layout()
plt.legend(loc=1,prop={'size':9})
plt.subplot(224)
data[["Congruent", "Incongruent"]].boxplot( return_type='dict', grid=False)
plt.ylabel('Time Scores', fontsize=10)
plt.xlabel('Type', fontsize=10)
plt.show()
Measuring the sample differences as $x_{D_i}=x_C{_i}-x_{I_i}$, we can report
The verbal and visual centers of cognition in the brain seems to be linked. When there is a contradiction between them, the brain seems to take longer time to process information. It would be intersting to see if there is a difference in cognition time to identify words with swaped letters.