-
Notifications
You must be signed in to change notification settings - Fork 10
t test paired (dependent samples)
Maurice HT Ling edited this page Aug 13, 2021
·
4 revisions
Purpose: To test whether 2 samples were drawn from the same population.
Null hypothesis: Mean of difference between Population A and Population B = 0
Alternate hypothesis: Mean of difference between Population A and Population B ≠ 0
Code:
>>> from scipy import stats
>>> X1 = [9.07, 8.97, 6.41, 3.03, 1.19, 2.67, 2.81, 9.2]
>>> X2 = [3.82, 8.26, 5.99, 3.81, 1.07, 5.06, 5.66, 4.47]
>>> result = stats.ttest_rel(X1, X2)
>>> print("t = %.3f" % result.statistic)
t = 0.621
>>> print("p-value = %.3f" % result.pvalue)
p-value = 0.555
Copyright (c) 2008-2024, Maurice HT Ling
Refereed Publications and Technical Reports
Abstracts and Other Un-Refereed Works
Autobiographic Verses (Poems that I wrote) and My Sayings