Analyzing the Stroop Effect

Perform the analysis in the space below. Remember to follow the instructions and review the project rubric before submitting. Once you've completed the analysis and write-up, download this file as a PDF or HTML file, upload that PDF/HTML into the workspace here (click on the orange Jupyter icon in the upper left then Upload), then use the Submit Project button at the bottom of this page. This will create a zip file containing both this .ipynb doc and the PDF/HTML doc that will be submitted for your project.

(1) What is the independent variable? What is the dependent variable?

The independeant variable is the color of ink which is used to print the word. The dependent variable is the time which is taken by participant to speak the name of color.

(2) What is an appropriate set of hypotheses for this task? Specify your null and alternative hypotheses, and clearly define any notation used. Justify your choices.

Null Hypothesis ( $H_{0}:\mu_{0}=\mu_{1}$)

  • The average times of two groups(one gorup who read congruent words, the other group who read incongruent wors), will be are equal.

Alternative Hypothesis ( $H_{1}:\mu_{0}\ne\mu_{1}$)

  • Participants will takes differnt time to speak the name of color, when they are watching incongruent wors.
  • Therefore, average times of two groups, are different

Statistical Test : t-test will be used

  • t-test is good to be used for comparing the means of two groups
  • In this case, the one group is congruent words, and the other group is incongruent words
  • The number of samples are lessn than 30

(3) Report some descriptive statistics regarding this dataset. Include at least one measure of central tendency and at least one measure of variability. The name of the data file is 'stroopdata.csv'.

In [1]:
# Perform the analysis here
import pandas as pd

df = pd.read_csv('stroopdata.csv')

df.describe()
Out[1]:
Congruent Incongruent
count 24.000000 24.000000
mean 14.051125 22.015917
std 3.559358 4.797057
min 8.630000 15.687000
25% 11.895250 18.716750
50% 14.356500 21.017500
75% 16.200750 24.051500
max 22.328000 35.255000

As centeral tendency, mean, is like below. Congruent mean = 8.630000 Incongruent mean = 15.687000

As a measureof variability, standard deviation is like below. Congruent stdev is 3.559358 Incongruent stdev is 4.797057

(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 [6]:
# Build the visualizations here
import matplotlib.pyplot as plt
%matplotlib inline
In [3]:
df.plot(kind='box')
Out[3]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a33bcdb978>

My observation is that average of incongruent is higher then average of congurent

In [5]:
df.plot(kind='hist', alpha=0.5)
Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x1a33c166240>

mode of incongruent is bigger than mode of congruent.

(5) Now, perform the statistical test and report your results. What is your confidence level or Type I error associated with your test? What is your conclusion regarding the hypotheses you set up? Did the results match up with your expectations? Hint: Think about what is being measured on each individual, and what statistic best captures how an individual reacts in each environment.

In [7]:
from scipy import stats
stats.ttest_rel(df['Congruent'], df['Incongruent'])
Out[7]:
Ttest_relResult(statistic=-8.020706944109957, pvalue=4.103000585711178e-08)

p-value is lower than 0.05, so null hypothesis is rejected.

(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!

I'll do it after I buy some time for it :)