Mathwords logoMathwords

Hypothesis Testing — Definition, Formula & Examples

Hypothesis testing is a systematic method for using sample data to decide whether a claim about a population parameter (such as a mean or proportion) is likely true or false. You set up two competing statements, collect data, and use probability to judge which statement the evidence supports.

A hypothesis test is a formal statistical inference procedure in which a null hypothesis H0H_0, representing no effect or a default value of a population parameter, is evaluated against an alternative hypothesis HaH_a by computing a test statistic from sample data and comparing its associated pp-value to a predetermined significance level α\alpha. If pαp \leq \alpha, the null hypothesis is rejected in favor of the alternative.

Key Formula

z=xˉμ0σ/nz = \frac{\bar{x} - \mu_0}{\sigma / \sqrt{n}}
Where:
  • xˉ\bar{x} = Sample mean
  • μ0\mu_0 = Hypothesized population mean under H₀
  • σ\sigma = Population standard deviation (known)
  • nn = Sample size

How It Works

First, state the null hypothesis H0H_0 (the default claim) and the alternative hypothesis HaH_a (what you suspect is true). Next, choose a significance level α\alpha, commonly 0.05. Then collect sample data and compute a test statistic, such as a zz-score or tt-score, that measures how far the sample result is from what H0H_0 predicts. Use the test statistic to find the pp-value — the probability of observing data at least as extreme as yours if H0H_0 were true. If the pp-value is less than or equal to α\alpha, reject H0H_0; otherwise, fail to reject H0H_0.

Worked Example

Problem: A factory claims its light bulbs last an average of 1000 hours. You test 36 bulbs and find a sample mean of 980 hours. The population standard deviation is known to be 60 hours. At the 0.05 significance level, is there evidence the true mean is less than 1000?
State hypotheses: Set up the null and alternative hypotheses.
H0:μ=1000Ha:μ<1000H_0: \mu = 1000 \quad H_a: \mu < 1000
Compute the test statistic: Plug the values into the z-test formula.
z=980100060/36=2010=2.0z = \frac{980 - 1000}{60 / \sqrt{36}} = \frac{-20}{10} = -2.0
Find the p-value and decide: For a left-tailed test, the p-value is P(Z ≤ −2.0) ≈ 0.0228. Since 0.0228 < 0.05, reject H₀.
p0.0228<0.05=αp \approx 0.0228 < 0.05 = \alpha
Answer: At the 0.05 significance level, there is sufficient evidence to conclude the true mean lifetime is less than 1000 hours.

Why It Matters

Hypothesis testing is the backbone of data-driven decisions in medicine, engineering, and social science. Clinical trials use it to determine whether a new drug outperforms a placebo. You will encounter it in AP Statistics, introductory college statistics, and any research methods course.

Common Mistakes

Mistake: Interpreting 'fail to reject H₀' as proof that H₀ is true.
Correction: Failing to reject H₀ means the data are not strong enough to rule it out — it does not confirm H₀. The test only measures evidence against the null, never evidence for it.