<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Name
Step1:  Variables
Step2:  Independent variable
Step3:  The above visualizations clearly show that the response time for the congruent words condition is much lower in comparison to the incongruent words condition.
Even if the two outliers present in Fig 2 are ignored, it is evident that not just the mean (14 seconds vs. 22 seconds), but the lower and upper bounds for both conditions are markedly different as well.
Fig 3 shows a scatter plot of response times from both treatment conditions. The plot shows that for every x value (time taken for congruent words) plotted, the y value (time taken for incongruent words) is higher.
Statistical Test
α
<ASSISTANT_TASK:>
Python Code:
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('whitegrid')
%pylab inline
Explanation: Name: Navina Govindaraj
Date: April 2017
Test a Perceptual Phenomenon: The Stroop Effect
The Stroop dataset contains data from participants who were presented with a list of words, with each word displayed in a color of ink. The participant’s task was to say out loud the color of the ink in which the word was printed. The task had 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. 
- In the incongruent words condition, the words displayed are color words whose names do not match the colors in which they are printed. In each case, the time it took to name the ink colors were measured in equally-sized lists.
End of explanation
stroop_data = pd.read_csv('./stroopdata.csv')
stroop_data.head()
Explanation: Variables
End of explanation
stroop_data.describe()
print "Median:\n", stroop_data.median()
print "\nVariance:\n", stroop_data.var()
fig, axs = plt.subplots(figsize=(18, 5), ncols = 3, sharey=True)
plt.figure(figsize=(8, 6))
sns.set_palette("Set2")
# Fig 1 - Congruent Words - Response Time
sns.boxplot(y="Congruent", data=stroop_data, 
            ax=axs[0]).set_title("Fig 1: Congruent Words - Response Time (in seconds)")
# Fig 2 - Incongruent Words - Response Time
sns.boxplot(y="Incongruent", data=stroop_data, color="coral", 
            ax=axs[1]).set_title("Fig 2: Incongruent Words - Response Time (in seconds)")
# Fig 3 - Congruence vs. Incongruence
sns.regplot(x="Congruent", y="Incongruent", data=stroop_data, color="m", fit_reg=False,
            ax=axs[2]).set_title("Fig 3: Congruence vs. Incongruence (in seconds)")
Explanation: Independent variable: Treatment condition consisting of congruent and incongruent words
Dependent variable: Response time 
Hypothesis
$H_0 :  \mu_C = \mu_I $ There is no difference in mean response time between the congruent and incongruent word conditions
$H_a :   \mu_C \neq \mu_I $ There is a difference in mean response time between the congruent and incongruent word conditions
$\mu_C$ and $\mu_I$ denote the population means for the congruent and incongruent groups respectively.
Statistical test: Dependent t-test for paired samples is the statistical test that will be used. 
This is a within-subject design, where the same subjects are being presented with two test conditions.
The reasons for choosing this test are as follows:
1) The sample size is less than 30
2) The population standard deviation is unknown
3) It is assumed that the distributions are Gaussian
Data Exploration and Visualization
End of explanation
# Dependent t-test for paired samples
stats.ttest_rel(stroop_data["Congruent"], stroop_data["Incongruent"])
Explanation: The above visualizations clearly show that the response time for the congruent words condition is much lower in comparison to the incongruent words condition.
Even if the two outliers present in Fig 2 are ignored, it is evident that not just the mean (14 seconds vs. 22 seconds), but the lower and upper bounds for both conditions are markedly different as well.
Fig 3 shows a scatter plot of response times from both treatment conditions. The plot shows that for every x value (time taken for congruent words) plotted, the y value (time taken for incongruent words) is higher.
Statistical Test
α: 0.05
Confidence level: 95%
t-critical value: 1.714
End of explanation
<END_TASK>