Tutorials › Introduction to Statistics › Choosing One-Sided or Two-Sided Mean Tests

Tests for Means · Tutorial 655 of 996

Choosing One-Sided or Two-Sided Mean Tests

Translate the research question into a mean-test alternative before examining the sample, then interpret the chosen tail without letting the observed result dictate it.

Intermediate 10 min read

What You'll Learn

  • Write null and alternative hypotheses for a one-sample mean test.
  • Distinguish lower-tailed, upper-tailed, and two-sided alternatives.
  • Match each tail to the direction of a prespecified scientific claim.
  • Understand how the chosen tail determines the p-value.
  • Explain why selecting a tail after seeing the sample is misleading.
  • Recognize when a directional question should instead use a two-sided test.

Introduction

A test of a mean can ask whether a population mean is below a target, above it, or simply different from it. These questions are not interchangeable: each specifies a different alternative hypothesis and assigns evidence in a different part, or parts, of the sampling distribution. The direction must come from the scientific question set before the sample results are examined.

For example, a quality manager might ask whether the average fill volume is less than the labeled amount, while a researcher might ask whether a new process changes average production time in either direction. The first question calls for a lower-tailed test; the second calls for a two-sided test. Neither choice should be made by checking which direction the observed sample mean happens to point.

Hypotheses and the Three Possible Tails

Let \(\mu\) be the population mean of interest and let \(\mu_0\) be a reference value specified by the question. A one-sample mean test compares the sample evidence with a null model centered at \(\mu_0\). Its alternative hypothesis states which departures from that reference count as evidence for the scientific claim.

Definition: A lower-tailed test has alternative \(H_a:\mu<\mu_0\). An upper-tailed test has alternative \(H_a:\mu>\mu_0\). A two-sided test has alternative \(H_a:\mu\ne\mu_0\). In the usual one-sample test notation, the null hypothesis is \(H_0:\mu=\mu_0\). For a one-sided test, the null model is evaluated at the boundary \(\mu=\mu_0\); the corresponding composite null includes means in the direction opposite the alternative.

The equality in the null hypothesis identifies the reference distribution used for the test. The alternative determines which outcomes count as evidence. Thus, a claim that the mean is lower than a target translates into \(H_a:\mu<\mu_0\), whereas a claim that the mean is different from the target in either direction translates into \(H_a:\mu\ne\mu_0\).

For a one-sample \(t\) test, the sample provides \(\bar{x}\), \(s\), and \(n\), and the test statistic is

$$ t=\frac{\bar{x}-\mu_0}{s/\sqrt{n}},\qquad df=n-1. $$

Under the null model and the conditions for one-sample \(t\) inference, this statistic has a \(t\) distribution with \(n-1\) degrees of freedom. The sample observations should be independent, and the data should be quantitative. The population distribution should be reasonably well behaved for a small sample; with a larger sample, the \(t\) procedure is generally more robust, though strong skewness or influential outliers still deserve attention. These assumptions support the reference distribution; they do not determine which alternative is appropriate.

The sign of \(t\) indicates whether \(\bar{x}\) is above or below \(\mu_0\), but the tail is chosen by the claim, not by that sign. The p-value is the probability, under the null model, of obtaining a test statistic at least as extreme in the direction or directions specified by \(H_a\). If \(F_{df}\) denotes the cumulative distribution function of the \(t\) distribution with \(df\) degrees of freedom, then the tail definitions are:

$$ \begin{aligned} \text{Lower-tailed:}\quad &p=F_{df}(t_{\mathrm{obs}}),\\ \text{Upper-tailed:}\quad &p=1-F_{df}(t_{\mathrm{obs}}),\\ \text{Two-sided:}\quad &p=2\min\{F_{df}(t_{\mathrm{obs}}),\,1-F_{df}(t_{\mathrm{obs}})\}. \end{aligned} $$

The two-sided formula counts equally extreme evidence in either direction. The one-sided formulas count only the tail specified by the alternative. Consequently, the same observed \(t\) statistic can have different p-values under different alternatives. A p-value is not the probability that the null hypothesis is true; it is a probability calculated assuming the null model.

Matching the Claim to the Alternative

Translate the scientific question before looking at the sample summary. Words such as less than and reduced generally imply a lower-tailed alternative; greater than and increased imply an upper-tailed alternative. Phrases such as different, changed, or not equal usually imply a two-sided alternative when departures in either direction matter.

A directional alternative is suitable only when the direction is substantively meaningful and was selected in advance. If an increase would matter but a decrease would not support the same claim, an upper-tailed test may fit the question. But if either an increase or a decrease would be important, use a two-sided test, even if one direction seems more plausible before data collection.

Worked Example: Testing for a Shortfall in Fill Volume

A hypothetical bottling line is intended to fill containers with 500 mL on average. Before collecting data, a quality team asks whether the line’s mean fill volume is below 500 mL. A random sample of 16 containers has a mean fill volume of 498.7 mL and sample standard deviation 2.4 mL. Assume the measurements are independent and the small-sample distribution has no severe skewness or influential outliers.

The question concerns a shortfall, so the hypotheses are

$$ H_0:\mu=500\text{ mL} \qquad\text{and}\qquad H_a:\mu<500\text{ mL}. $$

The observed difference from the reference is

$$ \bar{x}-\mu_0=498.7-500=-1.3\text{ mL}. $$

The negative difference points in the direction of the claim, but it did not choose the tail: the team’s question did. This is a lower-tailed test, so evidence against the null would be assessed in the lower tail of the \(t\) distribution, with \(df=16-1=15\). The sample summary alone does not establish that the mean is below 500 mL; the test statistic and its lower-tail p-value would be needed to assess the strength of evidence.

Worked Example: Testing for an Increase in Battery Life

In a hypothetical engineering test, a company’s established battery has a mean operating life of 10 hours under a specified protocol. Before testing a redesigned battery, engineers state that their claim is that its population mean operating life is greater than 10 hours. A random sample of 25 redesigned batteries has a mean life of 10.4 hours and standard deviation 1.5 hours. Suppose the measurements are independent and the sample shows no extreme outliers.

Because the prespecified claim is an increase, the hypotheses are

$$ H_0:\mu=10\text{ hours} \qquad\text{and}\qquad H_a:\mu>10\text{ hours}. $$

Here the observed difference is

$$ \bar{x}-\mu_0=10.4-10=0.4\text{ hours}. $$

The data point in the claimed direction, but that fact does not by itself show that the increase is statistically convincing. This is an upper-tailed test with \(df=25-1=24\); its p-value is the upper-tail probability beyond the observed \(t\) statistic under the null model. Had the sample mean instead been below 10 hours, the alternative would still be upper-tailed: the engineers would not switch tails after seeing the result.

Worked Example: Testing Whether a Mean Recovery Time Changed

A hypothetical clinic uses 36 hours as a reference mean recovery time after a procedure. Before collecting measurements, investigators decide that either a decrease or an increase would be scientifically important. In a random sample of 20 patients, the mean recovery time is 39.1 hours and the sample standard deviation is 6 hours. Assume independent observations and no severe departures from the conditions for a one-sample \(t\) test.

Because changes in either direction matter, the hypotheses are

$$ H_0:\mu=36\text{ hours} \qquad\text{and}\qquad H_a:\mu\ne36\text{ hours}. $$

The observed difference is

$$ \bar{x}-\mu_0=39.1-36=3.1\text{ hours}. $$

The sample mean is higher, but the test remains two-sided because the question was whether the mean changed in either direction. Its p-value counts outcomes at least as far from the null center as the observed statistic, on both sides of the \(t\) distribution, with \(df=20-1=19\). The sample direction can inform the description of the estimate, but it does not revise the alternative.

Why the Tail Must Be Chosen in Advance

A test’s significance level \(\alpha\) controls the probability of rejecting the null when the null model is true, provided the test and its assumptions are correctly specified. The direction of the alternative determines how that error probability is allocated. In a one-sided test, the rejection region is placed in one tail. In a two-sided test, it is divided between both tails.

For a continuous, symmetric \(t\) distribution under the null, let \(c\) be the upper-tail critical value that leaves probability \(\alpha\) above it. Symmetry means the corresponding lower-tail cutoff is \(-c\). Therefore,

$$ P(T\ge c)=\alpha,\qquad P(T\le -c)=\alpha. $$

For a two-sided test, each tail must instead contain \(\alpha/2\), because the total probability of falling into either rejection tail is

$$ P(|T|\ge c_2) =P(T\le -c_2)+P(T\ge c_2) =\frac{\alpha}{2}+\frac{\alpha}{2} =\alpha. $$

This shows why a two-sided test and a one-sided test do not use the same rejection rule at the same \(\alpha\). Choosing a tail after seeing which side the sample favors lets the data influence the rule for counting evidence. It can raise the chance of a false rejection above the stated significance level. Prespecifying the alternative, for example in a study plan, prevents that outcome-dependent choice.

A one-sided test is not a convenient way to get a smaller p-value when the sample happens to point in one direction. If an upper-tailed alternative was specified but the sample mean is below the reference, the result is not evidence for the upper-tailed claim. Reversing to a lower-tailed test after seeing that outcome does not preserve the original test’s error control. If both directions are scientifically relevant, the appropriate choice from the outset is two-sided.

Common Mistake: Letting the Sample Pick the Tail

A tempting argument is: “The sample mean is higher than the target, so I will use an upper-tailed test; that gives the p-value in the direction I observed.” This is incorrect because the observed result has been used both to choose the hypothesis and to assess evidence for it. The p-value then no longer has the interpretation and error rate of the prespecified test.

Instead, state the scientific claim independently of the data, write \(H_a\) from that claim, and keep that alternative regardless of whether \(\bar{x}\) is above or below \(\mu_0\). When the claim is genuinely about any departure, use a two-sided alternative. A statistically significant result in a two-sided test can be described alongside the estimated direction, but it does not change what the test asked.

Key takeaway: Choose \(H_a\) from the scientific question before examining the sample: \(<\) means lower-tailed, \(>\) means upper-tailed, and \(\ne\) means two-sided. Keep that choice fixed when analyzing the data.

Check Your Understanding

For each question, identify the alternative hypothesis and the appropriate tail. Explain briefly why the observed sample direction should or should not affect the choice.

  1. A manufacturer asks whether the mean mass of a package is below its 250 g target. Write \(H_a\) and name the tail.
  2. A researcher asks whether a new procedure changes the mean time to complete a task; either a shorter or longer time matters. Write \(H_a\) and name the tail.
  3. A study plan specifies an upper-tailed test. The sample mean is below the reference mean. Should the analyst switch to a lower-tailed test after seeing the sample? Why?
  4. In a two-sided test with significance level \(\alpha\), how is the total null rejection probability divided between the tails?
  5. Explain why choosing a one-sided test solely because the sample mean points in that direction can undermine the stated error rate.