Mathwords logoMathwords

Two-Tailed Test — Definition, Formula & Example

A two-tailed test is a hypothesis test that checks whether a parameter is different from a claimed value in either direction, higher or lower. You use it when you have no reason in advance to expect the change to go one particular way.

A two-tailed (two-sided) test has alternative hypothesis Ha:θ≠θ0H_a: \theta \neq \theta_0. Its rejection region lies in both tails of the test statistic's sampling distribution under H0H_0. At significance level α\alpha, each tail holds probability α/2\alpha/2. The p-value is the probability, assuming H0H_0 is true, of getting a test statistic at least as far from the null value as the observed one, in either direction.

Key Formula

p-value=2 P(Z≥∣z∣),reject H0 if ∣z∣≥zα/2\text{p-value} = 2\,P(Z \ge |z|), \qquad \text{reject } H_0 \text{ if } |z| \ge z_{\alpha/2}
Where:
  • zz = the observed value of the test statistic
  • ZZ = a standard normal random variable (use a t-distribution with the correct degrees of freedom for a t-test)
  • zα/2z_{\alpha/2} = the critical value that cuts off area α/2\alpha/2 in the upper tail
  • α\alpha = the significance level, split equally between the two tails

Worked Example

Problem: A machine is supposed to fill cereal boxes with a mean of 16 oz. The fill weights have known standard deviation σ=0.5\sigma = 0.5 oz. A random sample of 100 boxes has mean xˉ=16.1\bar{x} = 16.1 oz. At α=0.05\alpha = 0.05, is there evidence that the true mean differs from 16 oz?
Step 1: State the hypotheses. Overfilling and underfilling both matter, so the alternative is two-sided.
H0:μ=16Ha:μ≠16H_0: \mu = 16 \qquad H_a: \mu \neq 16
Step 2: Compute the standard error, then the test statistic.
SE=0.5100=0.05,z=16.1−160.05=2SE = \frac{0.5}{\sqrt{100}} = 0.05, \qquad z = \frac{16.1 - 16}{0.05} = 2
Step 3: Find the p-value by doubling the upper-tail area. A result as extreme in the lower tail would count too.
p-value=2 P(Z≥2)≈2(0.02275)=0.0455\text{p-value} = 2\,P(Z \ge 2) \approx 2(0.02275) = 0.0455
Step 4: Compare the results. With α=0.05\alpha = 0.05, each tail holds 0.025, so the critical values are ±1.96\pm 1.96. Both checks agree.
0.0455<0.05and∣2∣>1.960.0455 < 0.05 \quad \text{and} \quad |2| > 1.96
Answer: Reject H0H_0. The p-value is about 0.0455, which is below 0.05. There is convincing evidence that the true mean fill weight differs from 16 oz.

Why It Matters

A two-tailed test at level α\alpha always matches a (1−α)(1-\alpha) confidence interval. In the example, the 95% interval is 16.1±1.96(0.05)=16.1±0.09816.1 \pm 1.96(0.05) = 16.1 \pm 0.098, or (16.002,16.198)(16.002, 16.198). It excludes 16, just as the test rejected H0H_0. Two-sided tests are the default in AP Statistics free-response questions and in published research, unless a direction is justified before the data are collected.

Common Mistakes

Mistake: Reporting the one-tail area as the p-value. In the example this would give 0.02275 instead of 0.0455. Another version of this error is using the one-sided critical value 1.645 instead of 1.96.
Correction: In a two-sided test, extreme results in either direction count as evidence against H0H_0. Double the tail area. Put α/2\alpha/2 in each tail when you find the critical value.

Related Terms