Hypothesis testing and p-values

Database › Mathematics › Applied mathematics › Statistics

STAT-0006MethodUndergraduate

A hypothesis test computes, assuming a null hypothesis, the probability (p-value) of a result at least as extreme as the one observed, and rejects the hypothesis if it falls below a chosen significance level.

$$p=P(T\ge t_0\,|\,H_0);\qquad t=\frac{\bar x-\mu_0}{s/\sqrt n}\ \sim\ t_{n-1};\qquad z=\frac{\hat x-\mu_0}{\sigma}\ \sim\ N(0,1)$$

Explanation

Choose a test statistic whose distribution under $H_0$ is known. Rejecting when $p<\alpha$ wrongly rejects a true hypothesis with probability $\alpha$ (type I error); failing to reject a false one is a type II error, whose probability depends on the alternative and shrinks with more data (power).

A large $p$ does not prove $H_0$, and a small $p$ is not the probability that $H_0$ is true (that needs Bayes' theorem and a prior). Testing many hypotheses inflates false positives, which is why particle physics demands $5\sigma$ ($p\approx3\times10^{-7}$) for a discovery.

Example 1

The five measurements 4.9, 5.1, 5.3, 4.8, 5.4 ($\bar x=5.1$, $s/\sqrt5=0.114$) are compared with a predicted value 5.0. Is the difference significant?

Solution

$t=0.1/0.114=0.877$ with 4 degrees of freedom; two-sided $p\approx0.43$, so the data are fully consistent with 5.0.

Example 2

A coin gives 60 heads in 100 tosses. Test fairness at the 5% level using the Gaussian approximation.

Solution

Under $H_0$: mean 50, $\sigma=\sqrt{100\cdot\frac14}=5$, $z=2.0$, two-sided $p\approx0.046<0.05$ — rejected, but only marginally.

Related entries