Quiz 2

Week 10.1: Introduction to Hypothesis Testing

591 words
3 min read
Python Week 1: the first filter for runtime behavior
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:
  1. Start with a null hypothesis (H0H_0) — the "default" or "status quo".
  2. Collect data.
  3. If the data is unlikely under H0H_0, reject H0H_0 in favour of the alternative (H1H_1).
  4. Otherwise, fail to reject H0H_0 (not the same as "accepting" H0H_0).
Example: "Innocent until proven guilty." H0H_0: innocent. Evidence must be strong enough to convict (reject H0H_0).

2. Components of a Hypothesis Test

1. Null hypothesis H0H_0: A statement about a parameter, typically θ=θ0\theta = \theta_0. 2. Alternative hypothesis H1H_1: Can be:
  • Two-sided: θθ0\theta \neq \theta_0
  • One-sided (upper): θ>θ0\theta > \theta_0
  • One-sided (lower): θ<θ0\theta < \theta_0 3. Test statistic: A function of the data whose distribution under H0H_0 is known. 4. Rejection region: Values of the test statistic that lead to rejecting H0H_0. 5. Decision: Reject H0H_0 if test statistic falls in rejection region; otherwise fail to reject.

3. Errors in Hypothesis Testing

DecisionH0H_0 trueH0H_0 false
**Reject H0H_0 **Type I error ( α\alpha )Correct!
**Fail to reject H0H_0 **Correct!Type II error ( β\beta )
  • α=P(Type I error)=P(Reject H0H0 true)\alpha = \mathbb{P}(\text{Type I error}) = \mathbb{P}(\text{Reject } H_0 \mid H_0 \text{ true})significance level
  • β=P(Type II error)=P(Fail to reject H0H0 false)\beta = \mathbb{P}(\text{Type II error}) = \mathbb{P}(\text{Fail to reject } H_0 \mid H_0 \text{ false})
  • Power =1β=P(Reject H0H0 false)= 1 - \beta = \mathbb{P}(\text{Reject } H_0 \mid H_0 \text{ false})

4. Mermaid: Decision Flowchart

(Diagram)

5. The Test Statistic Approach

Step-by-step recipe:
  1. State H0H_0 and H1H_1.
  2. Choose α\alpha (commonly 0.050.05 or 0.010.01).
  3. Determine the appropriate test statistic.
  4. Find the critical value(s) from the reference distribution.
  5. Compute the test statistic from the data.
  6. Make a decision.

6. Power of a Test

The power of a test is the probability of correctly rejecting a false H0H_0. It depends on:
  • The true parameter value (effect size)
  • Sample size nn
  • Significance level α\alpha
  • 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:μ=10H_0: \mu = 10 vs H1:μ10H_1: \mu \neq 10 with α=0.05\alpha = 0.05, what is P(Type I error)\mathbb{P}(\text{Type I error})?
Full Solution
P(Type I error)=α=0.05\mathbb{P}(\text{Type I error}) = \alpha = 0.05 by definition.

Q2 (Medium)

If the probability of Type II error is 0.2, what is the power of the test?
Full Solution
Power =1β=10.2=0.8= 1 - \beta = 1 - 0.2 = 0.8.

Q3 (Hard)

Explain why "fail to reject H0H_0" is not the same as "accept H0H_0".
Full Solution
Failing to reject H0H_0 means the evidence was insufficient to conclude otherwise. It does not prove H0H_0 true — just that we couldn't detect a difference. This is like a "not guilty" verdict (lack of evidence for conviction), not "innocent".

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.