Block 82: SciPy: Hypothesis Testing
Perform t-tests and chi-square tests from Python.
Concepts
- stats.ttest_1samp(), stats.ttest_ind()
- p-value interpretation (0.05 threshold)
- stats.chi2_contingency() for categorical data
- Effect size concept
Code Examples
See exercise below.
Exercise
Test if the mean of a sample is significantly different from a hypothesized value. Compare means of two groups with an independent t-test. Interpret the p-value.
Homework
What does a p-value of 0.03 actually mean? Write the explanation you would give to a non-statistician. Tuesday