Background Information

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.

1. What is our independent variable? What is our dependent variable?

Independent variable

list of words

dependent variable

reaction time to name the ink colors

2. What is an appropriate set of hypotheses for this task? What kind of statistical test do you expect to perform? Justify your choices.

Hypotheses

Time to name the ink colors of congruent words less than time to name the ink colors of incongruent words.

Null hypothesis(H0) : Time to name the ink colors of congruent words and incongruent words are equaivalent. Alternative hypothesis(1) : Time to name the ink colors of congruent words less than incongruent words.

Staistical test

two-sample t-test.
Now it’s your chance to try out the Stroop task for yourself. Go to this link, which has a Java-based applet for performing the Stroop task. Record the times that you received on the task (you do not need to submit your times to the site.) Now, download this dataset which contains results from a number of participants in the task. Each row of the dataset contains the performance for one participant, with the first number their results on the congruent task and the second number their performance on the incongruent task.

In [1]:
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import ttest_ind
path = '/Users/Slimn/Desktop/Work/Project/Udacity/NanoDegree/P1/stroopdata.csv'
df = pd.read_csv(path)
print df


    Congruent  Incongruent
0      12.079       19.278
1      16.791       18.741
2       9.564       21.214
3       8.630       15.687
4      14.669       22.803
5      12.238       20.878
6      14.692       24.572
7       8.987       17.394
8       9.401       20.762
9      14.480       26.282
10     22.328       24.524
11     15.298       18.644
12     15.073       17.510
13     16.929       20.330
14     18.200       35.255
15     12.130       22.158
16     18.495       25.139
17     10.639       20.429
18     11.344       17.425
19     12.369       34.288
20     12.944       23.894
21     14.233       17.960
22     19.710       22.058
23     16.004       21.157

3. Report some descriptive statistics regarding this dataset. Include at least one measure of central tendency and at least one measure of variability.

Congruent   Incongruent

Mean 14.051125 22.01591667 Standard Error 0.726550901 0.979195185 Median 14.3565 21.0175 Mode #N/A #N/A Standard Deviation 3.559357958 4.797057122 Sample Variance 12.66902907 23.01175704 Kurtosis -0.205224823 2.688900198 Skewness 0.416899874 1.547590026 Range 13.698 19.568 Minimum 8.63 15.687 Maximum 22.328 35.255 Sum 337.227 528.382 Count 24 24 Confidence Level(95.0%) 1.50298505 2.025619571


In [5]:
summary = df.describe()
summary.transpose()


Out[5]:
count mean std min 25% 50% 75% max
Congruent 24 14.051125 3.559358 8.630 11.89525 14.3565 16.20075 22.328
Incongruent 24 22.015917 4.797057 15.687 18.71675 21.0175 24.05150 35.255

4. Provide one or two visualizations that show the distribution of the sample data. Write one or two sentences noting what you observe about the plot or plots.


In [4]:
#%matplotlib inline
#plt.figure()
ax = df.boxplot()
plt.title('Measure time takes to name the ink colors')
#plt.figure()
#plt.legend()


/Users/Slimn/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py:3: FutureWarning: 
The default value for 'return_type' will change to 'axes' in a future release.
 To use the future behavior now, set return_type='axes'.
 To keep the previous behavior and silence this warning, set return_type='dict'.
  app.launch_new_instance()
Out[4]:
<matplotlib.text.Text at 0x10815a910>

From the plot, mean time for congruent word ~14. mean time for congruent word ~22. the incongruent word have two sample outlier, this data set need to verify. participance taken short time to say for congruent word condition.

5. Now, perform the statistical test and report your results. What is your confidence level and your critical statistic value? Do you reject the null hypothesis or fail to reject it? Come to a conclusion in terms of the experiment task. Did the results match up with your expectations?


In [1]:
# Use scipy.stats.ttest_ind.
#t_stat, p_val = ttest_ind(df['Congruent'], df['Incongruent'], equal_var=False)
t_stat, p_val = ttest_ind(df['Congruent'], df['Incongruent'])
print "t_stat ", t_stat
print "P-value ", p_val


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-700f9ffb66a3> in <module>()
      1 # Use scipy.stats.ttest_ind.
      2 #t_stat, p_val = ttest_ind(df['Congruent'], df['Incongruent'], equal_var=False)
----> 3 t_stat, p_val = ttest_ind(df['Congruent'], df['Incongruent'])
      4 print "t_stat ", t_stat
      5 print "P-value ", p_val

NameError: name 'ttest_ind' is not defined

Statistic Test

critical statistic value = 0.05 confidential level = 0.95 p_value < 0.05 reject null hypothesis

Condclusion.

An independent-samples t-test was conducted to compare time to name ink color of congruent words and incongruent words conditions. There was a significant difference in taken time for congruent words (Mean=14.0511, STD=3.5594) and incongruent words (Mean=22.01591, STD=4.7971) conditions; t(24)= -6.5323, p = 6.5102e-08 These results show that ink color really does have an effect to human brain befoe alphabet.

6. Optional: What do you think is responsible for the effects observed? Can you think of an alternative or similar task that would result in a similar effect? Some research about the problem will be helpful for thinking about these two questions!

The human brain is reconize color before alphabet. The similar task is Search engines replacing our memory. Research name : Google Effects on Memory: Cognitive Consequences of Having Information at Our Fingertips by Betsy Sparrow, Jenny Liu, Daniel M. Wegner