Week 10.1: Introduction to Hypothesis Testing
591 words
3 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Week 10.1: Introduction to Hypothesis Testing > **Prerequisites:** CLT ([Week 5.2: Law of Large Numbers & Central Limit Theorem](/notes/01-foundation-bsma1004-stats-2-week05-16-lln-clt)), Confidence Intervals ([Week 8.2: Confidence Intervals](/notes/01-foundation-bsma1004-stats-2-week08-23-confidence-intervals)) >...

Week 10.1: Introduction to Hypothesis Testing
Prerequisites: CLT (Week 5.2: Law of Large Numbers & Central Limit Theorem), Confidence Intervals (Week 8.2: Confidence Intervals) Cross-links: BSMA3012 (Linear Stat Models) — significance testing Core question: How do we decide if a claim about a parameter is supported by data?
1. Intuition: The Scientific Method in Statistics
A hypothesis test is a formal decision procedure:
- Start with a null hypothesis (H0) — the "default" or "status quo".
- Collect data.
- If the data is unlikely under H0, reject H0 in favour of the alternative (H1).
- Otherwise, fail to reject H0 (not the same as "accepting" H0).
Example: "Innocent until proven guilty." H0: innocent. Evidence must be strong enough to convict (reject H0).
2. Components of a Hypothesis Test
1. Null hypothesis H0: A statement about a parameter, typically θ=θ0.
2. Alternative hypothesis H1: Can be:
- Two-sided: θ=θ0
- One-sided (upper): θ>θ0
- One-sided (lower): θ<θ0 3. Test statistic: A function of the data whose distribution under H0 is known. 4. Rejection region: Values of the test statistic that lead to rejecting H0. 5. Decision: Reject H0 if test statistic falls in rejection region; otherwise fail to reject.
3. Errors in Hypothesis Testing
| Decision | H0 true | H0 false |
|---|---|---|
| **Reject H0 ** | Type I error ( α ) | Correct! |
| **Fail to reject H0 ** | Correct! | Type II error ( β ) |
- α=P(Type I error)=P(Reject H0∣H0 true) — significance level
- β=P(Type II error)=P(Fail to reject H0∣H0 false)
- Power =1−β=P(Reject H0∣H0 false)
4. Mermaid: Decision Flowchart
(Diagram)
5. The Test Statistic Approach
Step-by-step recipe:
- State H0 and H1.
- Choose α (commonly 0.05 or 0.01).
- Determine the appropriate test statistic.
- Find the critical value(s) from the reference distribution.
- Compute the test statistic from the data.
- Make a decision.
6. Power of a Test
The power of a test is the probability of correctly rejecting a false H0. It depends on:
- The true parameter value (effect size)
- Sample size n
- Significance level α
- The test used
Goal: Design tests with high power. Low power means we might miss real effects.
7. Practice Questions
Q1 (Easy)
In a test of H0:μ=10 vs H1:μ=10 with α=0.05, what is P(Type I error)?
Full SolutionP(Type I error)=α=0.05 by definition.
Q2 (Medium)
If the probability of Type II error is 0.2, what is the power of the test?
Full SolutionPower =1−β=1−0.2=0.8.
Q3 (Hard)
Explain why "fail to reject H0" is not the same as "accept H0".
Full SolutionFailing to reject H0 means the evidence was insufficient to conclude otherwise. It does not prove H0 true — just that we couldn't detect a difference. This is like a "not guilty" verdict (lack of evidence for conviction), not "innocent".
Next topic: Week 10.2: Z-test & p-value — Z-test and p-value approach. Join Discord PreviousBayesian EstimationNextWeek 10.2: Z-test & p-value