Answer the question
In order to leave comments, you need to log in
How to find Student's t-test using python?
Sorry for the imprecisely worded question.
The teacher suggests finding the Student's t-test using this formula:
However, I noticed that I get different values compared to the scipy.stats.ttest_ind method -1.6127911643120085
- my answer
is -1.6123875817242772 - the answer received through ttest_ind(ctrl, test, equal_var =False)
-1.6126205013707797 - response received via ttest_ind(ctrl, test, equal_var=True)
My function now:
ctrl = df[df['group'] == 'A']['converted'] # pandas Series, control group
test = df[df['group'] == 'B']['converted'] # pandas Series, test group
t = (np.mean(ctrl) - np.mean(test)) / np.sqrt(
((np.std(ctrl) ** 2) / ctrl.size) + ((np.std(test) ** 2) / test.size )
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question