Chapter 17 of 30
Keep learning and build your Data Science skills.
Hypothesis Testing
Learn how statistical hypotheses are evaluated using sample data.
Theory
Hypothesis testing is a statistical method used to evaluate claims about a population using sample data.
The process commonly involves:
1. Define the null hypothesis
2. Define the alternative hypothesis
3. Choose a significance level
4. Calculate a test statistic
5. Determine a p-value or critical region
6. Make a statistical decision
The result should be interpreted in the context of the original problem.
Example
from scipy import stats
group_a = [10, 12, 11, 13, 12]
group_b = [14, 15, 13, 16, 15]
result = stats.ttest_ind(
group_a,
group_b
)
print(result)Output
A statistical test result comparing the two groups is produced.
Practice
Perform a simple hypothesis test and explain the result in context.
Interview Questions
1
What is hypothesis testing?
2
What is a null hypothesis?
3
What is a p-value?
Quick Quiz
Which option best describes this chapter?
A.Testing statistical claims
B.Creating HTML pages
C.Managing databases
D.Writing CSS