In [4]:

```
import pandas as pd
%matplotlib inline
```

In [3]:

```
df = pd.read_csv('stroopdata.csv')
df['diff'] = df['Incongruent'] - df['Congruent']
df
```

Out[3]:

The experiment takes participants with two test, congruent task and incongruent task. Congruent task is word with agreeing text and font color, while incongruent is a different text and its font color. Both of the task require the participants to say it out loud the word that are being display, and press 'Finish' button to see which time do they take. The control group is the congruent task, while experiment group is ingconruent task.

The independent variables is which makes differ between congruent task and incongruent task. ** That is words that are being displayed**. Participants are requested to say the font color of the words, which is the same for both control and experiment group. But while text displayed agree with color in congruent, incongruent is the other way around.

** The dependent variables is time participants take to complete the task**. The time is depend on whether the text agree with the font color being displayed. We can see that from the data, on average, the time participants took for incongruent task is different than when they solve congruent task. We will use statistical test to test whether the time is significantly different.

We design the hypothesis test as follows:

H0: $ \mu_\mathbf{congruent} = \mu_\mathbf{incongruent}$ The time took for population to solve both congruent task and incongruent task is the same, on average

HA:$\mu_\mathbf{congruent} \neq \mu_\mathbf{incongruent}$ The time took for population to solve both congruent task and incongruent task is different, on average

**two-sided** t-statistics. This is an experiment where we have limited data and samples, and we want to test our hypothesis to the population parameters.

In [28]:

```
df.describe()
```

Out[28]:

In [9]:

```
df.plot.scatter(x='Congruent',y='Incongruent');
```

The plot shown a moderaly weak correlation between congruent variable and incongruent variable.

In [12]:

```
(df.Incongruent - df.Congruent).plot.hist();
```

In [75]:

```
%%R
n = 24
mu = 7.964792
s = 4.864827
CL = 0.95
n = 24
# z = round(qnorm((1-CL)/2, lower.tail=F),digits=2)
SE = s/sqrt(n)
t = mu/SE
t_crit = round(qt((1-CL)/2,df=n-1),digits=3)
c(t,c(-t_crit,t_crit))
```

In [55]:

```
%%R
ME = t*SE
c(mu+ME,mu-ME)
```