- 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.
- 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())
0 70 1 75 2 80 3 85 4 80 Name: Treatment, dtype: int64 count 40.000000 mean 76.625000 std 11.231109 min 55.000000 25% 70.000000 50% 75.000000 75% 85.000000 max 100.000000 Name: Treatment, dtype: float64
t, p = stats.ttest_1samp(data.Treatment, 70.00) t, p