Prev: Paired t-test | Next: Chi Square test
Examples:
- In educational research: suppose you have a class of students learning mathematics with a specific innovative method. Use one sample t-test to identify whether the mean value of their performance in a standardized knowledge test is significantly different compared to the mean value of performance for all other students who have taken this test in the past.
- In elearning: suppose you offer an online course which has been offered also in the past but now has been redesigned as a gamified learning environment for the first time. After the course you run a reliable and validated knowledge test to measure learners' performance. Apply one sample t-test to investigate whether the mean of the gamified version is significantly different compared to the mean of learners' performance when delivering the course in the past.
where:
- Ms : the mean of the sample (the examined value)
- Mp : the mean of the population (the known and expected value)
- ss : the standard deviation of the sample
- n : the sample size.
import pandas as pd
import scipy.stats as stats
data = pd.read_excel('../../data/researchdata.xlsx', sheetname="ttest-indep")
print(data.Treatment.head(),'\n')
print(data.Treatment.describe())
stats.shapiro(data.Treatment)
t, p = stats.ttest_1samp(data.Treatment, 70.00)
t, p
. Free learning material
. See full copyright and disclaimer notice