Two-sided test

By Jude Wallis · Updated

A two-sided test has an alternative hypothesis using a not-equal sign, so a departure from the null in either direction counts as evidence.

A two-sided test states HaH_a with a not-equal sign, so the p-value collects probability from both tails: it is the chance, under H0H_0, of a statistic at least as far from the null value as yours in either direction. The null still carries an equals sign and the test is still run at that boundary. Use it whenever the question is only whether something changed.

Take z=1.75z = 1.75 from a test of H0:p=0.50H_0: p = 0.50. The upper tail area is P(Z>1.75)=0.0401P(Z > 1.75) = 0.0401, and the two-sided p-value is 0.0801. At α=0.05\alpha = 0.05 (alpha) that fails to reject, while the matching upper-tailed one-sided test gives 0.0401 and rejects. Identical data, opposite verdicts, which is why HaH_a is written before the data are seen.

Here is the sentence to stop writing: "a two-sided p-value is always twice the one-sided p-value." The doubling needs two conditions, that the null distribution is symmetric about the null value and that the one-sided alternative points the way the data actually fell. Keep z=1.75z = 1.75 and set Ha:p<0.50H_a: p < 0.50. That one-sided p-value is 0.9599, and twice it is 1.92, which is not a probability. The safe statement is that the two-sided p-value is twice the tail area beyond the observed statistic on the side where it landed.

Symmetry is a real condition. Test H0:p=0.30H_0: p = 0.30 with 10 successes in 20 trials against the exact binomial null instead of a normal model. The upper tail P(X10)P(X \ge 10) is 0.0480, so doubling would report 0.0959, but the outcomes at least as far from the null mean of 6 are X10X \ge 10 and X2X \le 2, which total 0.0480+0.0355=0.08340.0480 + 0.0355 = 0.0834. The zz and tt models this course uses are symmetric, so doubling is safe there; the reason is the model, not the word two-sided.

A two-sided test at α=0.05\alpha = 0.05 usually matches the 95% confidence interval, though for proportions the two can disagree in close cases, because the test builds its standard error from the null value and the interval from the sample.

Where this comes up

More hypothesis testing terms, or browse the full statistics glossary.