-
-
Save aditya0811/f856c1910845e1c85d042c055656fb4c to your computer and use it in GitHub Desktop.
student ttest_auto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a=np.array([27.5, 21.0, 19.0, 23.6, 17.0, 17.9, 16.9, 20.1, 21.9, 22.6, 23.1, 19.6,23]) | |
b=np.array([27.1, 22.0, 20.8, 23.4, 23.4, 23.5, 25.8, 22.0, 24.8, 20.2, 21.9, 22.1, 22.9, 20.5, 24.4]) | |
from scipy.stats import ttest_ind | |
stat, p = ttest_ind(a, b,equal_var=True) | |
print(stat) | |
>>>-2.0754319784177606 | |
#Though here variance of sample is not equal but we assumend it to be equal for conducting students t-test, | |
#(for unequal variance we will discuss Welsch's t-test later) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment