Skip to main content

Hypothesis Testing Foundations

Topic - A hypothesis is a formal, testable claim regarding an unknown population parameter. Hypothesis testing provides an objective statistical protocol to assess whether empirical sample data provides strong enough evidence to refute a baseline status-quo assumption.


1. Formulating Hypotheses​

Hypothesis testing sets up a contest between two contrasting statements:

The Null Hypothesis (H0H_0)​

The hypothesis of no effect, no difference, or status quo. It represents the baseline assumption that is presumed true unless the sample evidence proves overwhelmingly otherwise.

  • Contains an equality condition (==, ≥\ge, or ≤\le).
  • Example: A manufacturing plant claims battery lifespan is 25,500 hours (H0:μ=25500H_0: \mu = 25500).

The Alternative Hypothesis (HaH_a)​

The research hypothesis or claim of interest (also denoted H1H_1 in some literature, but standardized as HaH_a throughout these notes). It represents the claim that there is a genuine effect, difference, or change.

  • Directly contradicts the null hypothesis.
  • Contains a strict inequality (≠\neq, <<, or >>).
  • Example: A consumer watchdog claims the battery lifespan is less than 25,500 hours (Ha:μ<25500H_a: \mu < 25500).

2. The Decision Paradigm: "Fail to Reject" vs. "Accept"​

In scientific hypothesis testing, we never "accept" the null hypothesis. We either:

  1. Reject H0H_0: The sample evidence is sufficiently extreme that the null hypothesis is highly unlikely to be true.
  2. Fail to Reject H0H_0: There is insufficient sample evidence to conclude that the null hypothesis is false.
tip

The Legal Analogy: Presumption of Innocence

In a criminal trial, the defendant is presumed innocent until proven guilty (H0H_0: Innocent, HaH_a: Guilty). If evidence is lacking, the jury returns a verdict of "Not Guilty", not "Innocent". Failing to prove guilt does not prove innocence; it merely reflects an absence of conclusive evidence beyond a reasonable doubt.


3. Errors in Hypothesis Testing​

Because sample statistics fluctuate due to random sampling variability, decisions are subject to two fundamental types of error:

The Error Matrix​

RealityDecision: Reject H0H_0Decision: Fail to Reject H0H_0
H0H_0 is Actually TrueType I Error (α\alpha)
False Alarm (convicting an innocent person)
Correct Decision (1−α1 - \alpha)
Confidence Level
H0H_0 is Actually FalseCorrect Decision (1−β1 - \beta)
Statistical Power
Type II Error (β\beta)
Missed Detection (letting a guilty person walk free)

Tradeoffs and Error Control​

  • α\alpha (Significance Level): The maximum probability of committing a Type I error that the researcher is willing to tolerate (typically set to 0.050.05 or 0.010.01).
  • β\beta: The probability of committing a Type II error.
  • The Inversion: For a fixed sample size nn, lowering α\alpha (making it harder to reject H0H_0) automatically increases β\beta (increasing the chance of missing a real effect). Both errors cannot be minimized simultaneously without increasing the sample size nn.

Power of the Test (1−β1 - \beta)​

The probability of correctly rejecting a false null hypothesis. High power (>80%> 80\%) indicates that the test is sensitive enough to detect true effects.


4. Number of Tails​

The mathematical direction in HaH_a determines the placement of the rejection region under the null sampling distribution:


  • Hypothesis: H0:μ=μ0H_0: \mu = \mu_0 vs. Ha:μ≠μ0H_a: \mu \neq \mu_0
  • Rejection Region: Split equally into both tails (α/2\alpha / 2 in each tail).
  • Use Case: Testing whether average output differs in either direction (e.g., machine filling bottles: both underfilling and overfilling are defects).

Formulation Scenarios from Course Material​

Business ScenarioFormulated HypothesesTest TypeTail Placement
Bolt Production: A company claims that the average number of bolts manufactured daily is 60.H0:μ=60H_0: \mu = 60
Ha:μ≠60H_a: \mu \neq 60
Two-TailedSplit equally across both tails (α/2\alpha / 2)
Virus Testing Kit: A new testing kit takes less time than the standard kit that takes 34 hours for results.H0:μ≥34H_0: \mu \ge 34
Ha:μ<34H_a: \mu < 34
Left-TailedConcentrated entirely in the lower tail (α\alpha)
Stock Outperformance: An analyst tests whether Apple Inc. stock outperformed in 2019 by more than 13.5%.H0:μ≤13.5H_0: \mu \le 13.5
Ha:μ>13.5H_a: \mu > 13.5
Right-TailedConcentrated entirely in the upper tail (α\alpha)

Practice Check: Identifying Test Types​

ObjectiveNull Hypothesis (H0H_0)Alternative Hypothesis (HaH_a)Classification
Mean diastolic blood pressure for 85 adults is less than 90 mmμ≥90\mu \ge 90μ<90\mu < 90Left-Tailed Test
Tensile strength of an alloy is more than 500 Paμ≤500\mu \le 500μ>500\mu > 500Right-Tailed Test
Average heart rate of a healthy adult is 85 beats per minuteμ=85\mu = 85μ≠85\mu \neq 85Two-Tailed Test
Yield of BT cotton exceeds 450 kg lint per hectareμ≤450\mu \le 450μ>450\mu > 450Right-Tailed Test

5. Three Decision-Making Criteria​

There are three mathematically equivalent methods for deciding whether to reject H0H_0:

1. The Critical Region (Rejection Region) Approach​

  • Determine critical cutoff zcritz_{\text{crit}} from the normal distribution table for the chosen α\alpha.
  • Two-tailed: Reject H0H_0 if ∣Zcalc∣>zα/2|Z_{\text{calc}}| > z_{\alpha/2}.
  • Left-tailed: Reject H0H_0 if Zcalc<−zαZ_{\text{calc}} < -z_{\alpha}.
  • Right-tailed: Reject H0H_0 if Zcalc>zαZ_{\text{calc}} > z_{\alpha}.

2. The P-Value Approach​

The pp-value is the probability, assuming H0H_0 is true, of observing a test statistic as extreme as, or more extreme than, the value obtained from our sample.

  • Decision Rule: If p-value≤α  ⟹  Reject H0\text{If } p\text{-value} \le \alpha \implies \text{Reject } H_0 If p-value>α  ⟹  Fail to Reject H0\text{If } p\text{-value} > \alpha \implies \text{Fail to Reject } H_0
  • "If the p-value is low, the null must go. If the p-value is high, the null will fly."

3. The Confidence Interval Approach (Two-Tailed Tests)​

Construct the 100(1−α)%100(1 - \alpha)\% confidence interval around the sample mean xˉ\bar{x}.

  • If the hypothesized population parameter μ0\mu_0 does not lie inside the confidence interval, Reject H0H_0 at significance level α\alpha.
  • If μ0\mu_0 falls within the interval, Fail to Reject H0H_0.

6. Synthesis & Review​

Testing Principles

  • Directionality: Direction of HaH_a determines the critical tail. ≠\neq yields two tails; &lt; yields left tail; &gt; yields right tail.
  • Equivalence: The Critical Region, P-value, and Confidence Interval approaches always yield identical statistical decisions for two-tailed tests.

Common Traps

  • Never say 'Accept H0': Lack of evidence against the null is not proof of the null.
  • Do not change tails post-hoc: Formulate H0H_0 and HaH_a before observing the sample data to avoid p-hacking.

info

Key Takeaways

  • Alpha (α\alpha): The false-positive threshold, set by design prior to experimentation.
  • P-Value: A measure of evidence against H0H_0. Smaller pp-values indicate stronger evidence against the null hypothesis.
  • Statistical Power (1−β1 - \beta): The ability of an experiment to detect an actual effect when one exists. Higher sample sizes increase power.

Next Section: Large Sample Tests - implementing one-sample and two-sample Z-tests in Python.