Project summary - Congruent vs Incongruent
1) What is our independent variable? What is our dependent variable?
1)Independent variable:It can be be congruent or incongruent. 2)Dependent variable:It is time that takes for complete the task by the participant
2) What is an appropriate set of hypotheses for this task? What kind of statistical test do you expect to perform? Justify your choices.
The two-tailed t-test is the appropriate methods for this sample of data: The dataset does not include population μ and σ. Therefore, we cannot conduct a z-test. We can compare two means from 2 samples and calculate the standard deviation and confidence level 1)The null hypotheses is: The average time it takes to complete the incongruent test is less than or equal to the average time needed to complete the congruent test.
2)The alternative hypotheses is: The average time it takes to complete the incongruent test is more than the average time needed to complete the congruent test.
=>µx = incongruent condition population mean =>µy = congruent condition population =>µD = µx - µY =>H0: µD = 0 =>HA: µD ≠ 0 (two-tailed test)
import pandas as pd
import matplotlib.pyplot as plt
import math
df = pd.read_csv(r'stroopdata.csv')
df["p-id"]= df.index +1
df
The two-tailed t-test is the appropriate methods for this type of sample:
a)We cannot conduct a z-test since the sample doesnot include population μ and σ.
b)Since we can calculate the means of congruent and uncongruent we can apply T test.
3)descriptive statistics regarding this dataset.
The below code will give stats like mean,std of Congruent and Incongruent timings
thereult = df.describe()
thereult[1:3]
The below code will give median value of Congurent
median_of_Congruent = df['Congruent'].median()
median_of_Congruent
The below code will give median value of Incongruent
median_of_Incongruent = df['Incongruent'].median()
median_of_Incongruent
plt.hist(df['time-diff'].values,bins=10)
plt.xlabel("Time-diff")
plt.ylabel("Frequency")
plt.title("Histogram of time difference ")
plt.xticks(range(0, 25, 2))
plt.show()
From the above graph we came to know that the time-difference is between 2 to 12 seconds and average time difference is around 7.5 to 8.3There are two outliers in this data in between 16-18 and 20-22
5) Statistical test & result
Confidence Interval=90% α=0.1 T−critical=+1.714,−1.714
y=df['Incongruent']
x=df['Congruent']
d=y-x
d
mean_d=d.mean()
mean_d
#standard error of the mean difference
sdd = d.std()/math.sqrt(24)
sdd
t_statistic=mean_d/sdd
t_statistic
Result: We can regect null hypothesis since there is no much difference in responce time (t-statistic = 8.027 > t-critical = 1.714). The avg time that takes by the person to complete the test in an incongruent setting is longer than congruent setting test.