In [15]:
%matplotlib inline
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style='ticks', context='poster', font_scale=1.5)
In [16]:
data = pd.read_csv('./stroop_stats_2018.csv')
data.drop('when', axis=1, inplace=True)
data.time_normal = data.time_normal.str.strip(' ms').str.replace(',', '').astype(float)
data.time_interfere = data.time_interfere.str.strip(' ms').str.replace(',', '').astype(float)
data['time_diff'] = data.time_interfere - data.time_normal
In [17]:
max_rt = data.time_interfere.mean() + 2*data.time_interfere.std()
data = data.loc[data.time_interfere < max_rt]
max_rt = data.time_normal.mean() + 2*data.time_normal.std()
data = data.loc[data.time_normal < max_rt]
In [18]:
data.head()
Out[18]:
In [19]:
data.describe()
Out[19]:
In [20]:
g = sns.distplot(data.pct_correct, rug=True,
color='dodgerblue')
g.set_xlabel('% correct')
sns.despine(trim=True)
In [21]:
data_long = pd.melt(data, ['pct_correct'])
data_long = data_long.loc[data_long.variable.isin(['time_normal', 'time_interfere'])]
data_long.loc[data_long.variable == 'time_normal', 'variable'] = 'congruent'
data_long.loc[data_long.variable == 'time_interfere', 'variable'] = 'incongruent'
In [22]:
g = sns.factorplot(x='variable', y='value',
aspect=1.5, ci=95,
data=data_long, palette='Set2')
g.set_ylabels('RT (ms)')
g.set_xlabels('condition')
plt.locator_params(nbins=5)
How much longer does it take to respond to an incongruent vs. a congruent trial?
In [23]:
g = sns.distplot(data.time_diff, rug=True,
color='mediumpurple', vertical=True)
g.set_ylabel('RT for incongruent > congruent trials (ms)')
g.hlines(0, 0, .003, linestyles='dashed')
sns.despine(trim=True)
In [ ]:
In [ ]: