4.8 One-tailed tests

Sometimes only one direction would worry us. Why spend half the error budget on the other?

A paper mill discharges effluent into a river. The state pollution control board sets a limit on biochemical oxygen demand of 30 mg per litre, and the mill claims its average discharge is below that limit.

Only one direction matters here. Nobody objects if the effluent is far cleaner than required; the concern is entirely about exceeding the limit. So the claim being tested is one-sided:

\[H_0 : \mu \geq 30 \qquad H_A : \mu < 30\]

All the probability we are willing to risk now goes into a single tail, so the critical value moves inward: \(-Z_{0.05} = -1.645\) rather than \(\pm 1.96\).

qnorm(0.05)             # left-tailed critical value at 5%
#> [1] -1.645
qnorm(0.95)             # right-tailed critical value at 5%
#> [1] 1.645

In R, add the alternative argument:

bod <- make_sample(n = 20, mean = 29.2, sd = 7)

z.test(bod, mu = 30, sigma.x = 7, alternative = "less", conf.level = 0.95)
#> 
#>  One-sample z-Test
#> 
#> data:  bod
#> z = -0.51, p-value = 0.3
#> alternative hypothesis: true mean is less than 30
#> 95 percent confidence interval:
#>     NA 31.77
#> sample estimates:
#> mean of x 
#>      29.2

\(Z_{calc} = -0.51\), which is not below \(-1.645\), so we fail to reject. The mill’s claim is not supported by this sample — a mean of 29.2 would arise about 30% of the time even if the true average were exactly at the limit.

Two details in that output are worth noticing. The interval has an upper limit of 31.77 for a left-tailed test, which looks wrong and is not; that is the subject of the last part of this section. And z.test() prints NA for the lower limit where it means \(-\infty\), whereas t.test() prints -Inf below. The two packages simply report the same thing differently.

Unknown σ: the one-sided t-test

Nothing about one-tailed testing is special to the \(Z\)-test. When \(\sigma\) is unknown, the same alternative argument does the same job.

Return to the faculty teaching hours. The dean claims 11.0 hours per week, and suppose we specifically suspect the true figure is lower — we are not interested in the possibility that faculty teach more.

\[H_0 : \mu \geq 11 \qquad H_A : \mu < 11\]

t.test(hours, mu = 11, alternative = "less", conf.level = 0.90)
#> 
#>  One Sample t-test
#> 
#> data:  hours
#> t = -2.9, df = 7, p-value = 0.01
#> alternative hypothesis: true mean is less than 11
#> 90 percent confidence interval:
#>  -Inf 10.1
#> sample estimates:
#> mean of x 
#>     9.225

Notice that nothing fundamental has changed.

  • The hypotheses are written exactly as before.
  • The direction comes from alternative, not from a different formula.
  • The \(p\)-value is one-sided — 0.012 here, half the two-sided 0.024 we computed earlier.
  • The confidence interval is one-sided, running from \(-\infty\) to 10.10.
  • The only substantive change is the reference distribution: Student’s \(t\) with 7 degrees of freedom in place of the normal.

There are not six different procedures to learn. There are two — the \(Z\)-test when \(\sigma\) is known and the \(t\)-test when it is not — and each can be pointed in any of three directions.

Everything else stays the same.

The one-sided interval looks backwards

This trips up nearly everyone. For a left-tailed test, the confidence interval is

\[\left(-\infty,\ \bar{x} + Z_\alpha \frac{\sigma}{\sqrt{n}}\right)\]

An upper bound — for a left-tailed test. Why?

Start from the rejection rule and solve for \(\mu_0\) rather than for \(\bar{x}\):

\[ \begin{aligned} \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} &< -Z_\alpha \\[4pt] \bar{x} - \mu_0 &< -Z_\alpha \frac{\sigma}{\sqrt{n}} \\[4pt] \mu_0 &> \bar{x} + Z_\alpha \frac{\sigma}{\sqrt{n}} \end{aligned} \]

The inequality flipped when \(\mu_0\) moved across. So we reject exactly when \(\mu_0\) is too large, and the values we fail to reject are those with \(\mu \le \bar{x} + Z_\alpha\,\sigma/\sqrt{n}\).

The result is identical for the \(t\)-test. Replace \(Z_\alpha\) with \(t_{\alpha,\,n-1}\) and \(\sigma\) with \(s\); not a single step of the argument changes. That is why the interval above ran to 10.10 rather than starting there.

The rejection region is defined in \(Z\)-space; the confidence interval lives in parameter space. Solving the inequality for \(\mu\) reverses the direction.

Put plainly: a left-tailed test rejects when the sample mean comes out too small. So the values of \(\mu\) it rules out are the ones that are too large relative to what we saw. That leaves an upper bound.