For a quick demonstration, say the color each word is printed in below (not the color name that is spelled out) as quickly as possible. Start with List 1, take a short break, and then try List 2.
LIST 1:¶
ORANGE BLUE RED BLACK GREEN
LIST 2:¶
BLUE BLACK GREEN ORANGE RED
For most people, the color names printed in the corresponding color are faster to say than when the opposite is true.
This short example shows the Stroop effect, which can be defined as a demonstration of interference in the reaction time of a task.
The independent variable is the color the text is printed in, either congruent or incongruent to the color name.
The dependent variable is the time it takes a subject to read the congruent and incongruent lists of words.
From trying the task myself I believe that for the provided sample dataset, on average, it will take less time for a subject to say the congruent words compared to non-congruent.
Hypothesis Test
$$H_0: \mu_c = \mu_i$$$$H_a: \mu_c < \mu_i$$In the above equations, $\mu_c$ representes the population average for the congruent test, and $\mu_i$ represents the population average for the incongruent test. The null hypothesis states that the time to complete the congruent and incongruent tests will be the same. The alternative hypothesis states that the congruent test will not take as long to complete as the incongruent test.
I will be testing whether or not there is a statistically significant difference between the samples that will then allow us to make inferences about the population as a whole.
I will use a dependent t-test for paired samples with an $\alpha$ level of .05 to examine my hypothesis.
The t-test is appropriate here because the sample size is small, less than 30, and the population standard deviation is unknown. Using a t-test assumes the data is on an interval scale of measurement, the population was randomly selected, and the sets of data collected are linked, in this case each 'subject' produced two scores - one when the congruent test was taken, and another when the incongruent test was taken.
#package import
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
#csv file import
stroop_data = pd.read_csv(r"C:\Users\Mike\Desktop\stroopdata.csv")
#check data for proper formatting
stroop_data.head()
#make sure the columns and data types are the expected values
stroop_data.info()
#take a look at some quick statistics from the data
stroop_data.describe()
From the descriptive statistics provided in the previous cell, we can see that the sample mean for congruent is less than the sample mean for incongruent. The standard deviation (std) is also provided, and shows there is a bigger spread in the incongruent data points compared to congruent.
#create grouped bar graph of the data
n_groups = 24
congruent_data = stroop_data['Congruent']
incongruent_data = stroop_data['Incongruent']
width = .8
index = np.arange(0, n_groups * 2, 2)
fix, ax = plt.subplots()
rects1 = ax.bar(index, congruent_data, width, color='b')
rects2 = ax.bar(index+width, incongruent_data, width, color='r')
ax.set_xticks(index + width)
ax.set_xticklabels((1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24))
ax.set_ylabel('Time to Complete Test in Seconds', fontsize = 12)
ax.set_xlabel('Subject', fontsize = 12)
ax.set_title('Graph of Congruent and Incongruent Datasets', fontsize = 14)
ax.legend((rects1[0], rects2[0]),('Congruent', 'Incongruent'), loc = 2)
plt.show()
The above grouped bar graph shows the different data points for each subject in the dataset. The graph clearly shows that, for every subject in the sample, the time to complete the congruent test was less than the time to complete the incongruent test.
The process for calculating a dependent t-test for paired samples will be shown below. Calculations will be done in a spreadsheet program.
t-test Formula
$$t = \frac{\mu_c - \mu_i}{\displaystyle s_d /\sqrt{n}}$$The point estimate for this test is $\mu_c - \mu_i$.
Using the sample means values calculated earlier we find that: $14.05 - 22.02 = -7.97$
The next value needed is the standard deviation of the difference.
$s_d = 4.87$
$$t = \frac {-7.97}{4.87 / \sqrt{24}}$$We can now calculate the t-statistic using the formula shown before and plugging in the values we already found. $n$ in this case is $24$ as that was our sample size.
$$t = -8.10$$
The next step is using the t-table to find our t-critical value. We will use a one-tailed test in the negative direction since our alternative hypothesis states we are looking for a negative difference between the samples. Our alpha level will be the standard .05. The degrees of freedom used to look up the t-critical value is 23, which is the sample size minus 1.
$$\alpha = .05$$
$$t.critical = -1.714$$
Now we can make our analysis. The t-statistic that was calculated from the sample data was found to be $t = -8.10$. The t-critical value was determined to be t-critical $= -1.714$. Since the t-statistic is less than the t-critical (the calculated t-statistic is found within the critical region), we can reject the null hypothesis for the population as a whole.
There was a statistically significant difference between congruent and incongruent test times for our sample at an $\alpha$ level of .05.
I will calculate an effect size measure for this experiment, Cohen's d. Cohen's d is equal to the mean difference divided by the standard deviation.
Cohen's d = -7.97/4.87 = -1.64
A Cohen's d value over 1 means that the difference between the means is larger than one standard deviation. From this we can conclude that the effect of changing the printed words from congruent to incongruent in the experiment is very, very large.
Conclusion: This test shows that there is a statistical difference between the congruent and incongruent experiments. We can say (since this was an experimental design) that the parameters of the congruent test caused a person to complete the experiment faster than the incongruent test.
The results matched up with my expectations based on my own experience taking the test, and with my initial review of the descriptive statistics and plot of the data.
I found the theories that have been put forth to explain the effect quite interesting. The most plausible sounding to me is the idea that different pathways in the brain are activated when a person participates in the experiment. The path focused on 'reading' is more developed then the path focused on 'color information processing' and thus can process information faster. This difference in processing speed leads to the statistical difference that was examined in this report.
Perhaps the most interesting aspect of the whole experiment and resulting investigations is that we cannot say for sure what exactly causes the effect. The way the human brain works is still not fully understood, and it is impossible to say that one explanation for the Stroop effect would be applicable to every person who participated in the experiment.
Resources used to complete the project:
http://stackoverflow.com/questions/29067541/rmarkdown-how-to-change-the-font-color
https://www.codecogs.com/latex/eqneditor.php
https://www.sharelatex.com/learn/Subscripts_and_superscripts
http://stackoverflow.com/questions/14051715/markdown-native-text-alignment
https://en.wikipedia.org/wiki/Stroop_effect
http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.legend