Run an A/B Test with a T-Test
Advanced · Write the code · from SciPy Statistics: Distributions, Hypothesis Tests, and Correlations
From the lesson: SciPy Statistics: Distributions, Hypothesis Tests, and Correlations
A pharmaceutical company develops a new headache medicine. They give it to 100 patients and a placebo to another 100. The treatment group reports slightly fewer headaches. But is that difference real, or just random chance? This is the question statistics answers.
Read the lessonYou ran an A/B test on email subject lines. Group A (old subject) and Group B (new subject) have different open rates. Run an independent samples t-test using stats.ttest_ind(). Print the t-statistic rounded to 2 decimal places, the p-value rounded to 4 decimal places, and whether the result is 'Significant' or 'Not significant' at alpha=0.05.
More SciPy Statistics exercises
All Python exercises · 50 practice problems · Data Science & Machine Learning quiz