Tutorials › Introduction to Statistics › Choosing One-Sided Alternatives Before Seeing the Data

Inference for the Regression Slope · Tutorial 904 of 996

Choosing One-Sided Alternatives Before Seeing the Data

Choose the direction of a slope test from the scientific question in advance, then interpret its p-value without letting the observed slope change the hypothesis.

Intermediate 9 min read

What You'll Learn

  • State directional and two-sided alternatives for a specified population slope.
  • Distinguish a one-sided test from a two-sided test by the research question.
  • Calculate a directional slope-test statistic and p-value.
  • Explain why selecting a one-sided alternative after seeing the estimated slope makes the p-value misleading.
  • Identify when an unexpected slope direction should be reported rather than used to reverse the test.

Why the Direction Must Come First

A regression analysis can ask whether the population slope differs from a specified value, or whether it is specifically greater or less than that value. The choice changes the hypothesis test: a one-sided test counts evidence in one direction, while a two-sided test counts evidence in either direction. That choice must follow the research question and be made before looking at the estimated slope or test statistic.

Suppose a research question predicts that a higher value of a predictor is associated with a higher mean response. A positive-slope alternative may fit that question. If the question is simply whether there is a linear association, with no justified direction, the alternative should allow either a positive or negative slope. Choosing whichever direction happens to match the observed estimate makes a nominal one-sided p-value too small too often under the null hypothesis.

Definition: For a specified null slope \(\beta_{1,0}\), a right-sided alternative is \(H_a:\beta_1>\beta_{1,0}\), and a left-sided alternative is \(H_a:\beta_1<\beta_{1,0}\). A two-sided alternative is \(H_a:\beta_1\ne\beta_{1,0}\). The direction is chosen from the research question before examining the results.

Model and Test Logic

For slope inference, the simple linear regression model is \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(Y_i\) is the response for observation \(i\), \(x_i\) is its predictor value, and \(\beta_1\) is the population slope. The slope describes the change in mean response associated with a one-unit increase in the predictor. It does not, by itself, establish a causal effect.

The usual exact t test assumes a linear mean relationship, independent errors with mean zero and a common variance, and normally distributed errors conditional on the predictor values. The observations and sampling or study design must also support the intended inference. Under these conditions, when \(H_0:\beta_1=\beta_{1,0}\) holds, the statistic

$$ T=\frac{b_1-\beta_{1,0}}{SE(b_1)} $$

has a t distribution with \(df=n-2\). Here \(b_1\) is the estimated slope and \(SE(b_1)\) is its standard error. For a right-sided alternative, the p-value is the probability under the null model of a t statistic at least as large as the observed value. For a left-sided alternative, it is the probability of a statistic at least as small. For a two-sided alternative, it is the probability of a statistic at least as far from zero in either direction.

The p-value is calculated using the alternative specified in advance. At significance level \(\alpha\), the test rejects \(H_0\) when the p-value is no greater than \(\alpha\). A small p-value is evidence against the null in the direction or directions included in \(H_a\); it is not the probability that the null hypothesis is true.

Worked Example: A Prespecified Positive Direction

In a hypothetical study of \(n=20\) participants, researchers examine the linear association between weekly practice time, measured in hours, and a performance score, measured in points. Before examining the regression output, they specify the question: is the population slope positive? The model conditions are assumed to be reasonably supported for this illustration. Test \(H_0:\beta_1=0\) against \(H_a:\beta_1>0\) at \(\alpha=0.05\). The fitted slope is \(b_1=0.84\) points per hour and \(SE(b_1)=0.30\) points per hour.

The statistic is

$$ t=\frac{0.84-0}{0.30}=2.80,\qquad df=20-2=18. $$

The right-sided p-value is \(P(T_{18}\ge 2.80)\), approximately \(0.006\). Since \(0.006<0.05\), reject \(H_0\). The data provide evidence, under the stated model, that the population mean performance score increases with weekly practice time. The estimated increase is 0.84 points per additional hour, but the test concerns evidence about the population slope, not a guarantee that the relationship is causal.

Matching the Alternative to the Question

The alternative hypothesis expresses what the analysis is designed to detect. If the substantive question only predicts an increase relative to a specified slope, a right-sided alternative may be suitable. If it predicts a decrease, a left-sided alternative may be suitable. If either direction would matter, or if there is no defensible directional prediction, use a two-sided alternative.

A one-sided alternative is not simply a way to obtain a smaller p-value. It makes a narrower claim and deliberately treats evidence in the opposite direction as not supporting the stated alternative. For example, a test of \(H_a:\beta_1>0\) does not count a strongly negative slope as evidence for the research claim, even though that result may be important and should be reported. Choosing a direction should be justified by the question and relevant prior scientific reasoning, not by which direction the sample happens to show.

Worked Example: A Prespecified Negative Direction

A hypothetical environmental analysis asks whether higher pollutant concentration is associated with a lower mean plant-growth measurement. Before examining results, the analyst specifies \(H_0:\beta_1=0\) against \(H_a:\beta_1<0\). The conditions for the slope t test are assumed to be reasonably supported. There are \(n=12\) observations, and the estimated slope is \(-1.10\) millimeters of growth per concentration unit, with standard error \(0.50\) millimeters per concentration unit.

The test statistic and degrees of freedom are

$$ t=\frac{-1.10-0}{0.50}=-2.20,\qquad df=12-2=10. $$

Because the alternative is left-sided, the p-value is \(P(T_{10}\le -2.20)\), approximately \(0.026\). At \(\alpha=0.05\), reject \(H_0\). The results provide evidence of a negative population slope: in the model, higher pollutant concentration is associated with lower mean plant growth. This conclusion is directional and associational; it does not establish that pollutant concentration caused the change.

Why Choosing a Direction Afterward Fails

A t statistic can be positive or negative. Under the null hypothesis, its t distribution is symmetric around zero. If a researcher first looks at the statistic and then chooses the tail that makes the result appear more extreme, the resulting procedure has effectively searched in both directions, even though it reports only a one-sided p-value.

The inflation can be shown directly. Let \(c\) be the positive cutoff whose upper-tail probability under the null t distribution is \(\alpha\), so \(P(T\ge c)=\alpha\). If the direction was fixed in advance as right-sided, the chance under \(H_0\) of crossing that cutoff is \(\alpha\). But if the analyst selects the direction to match the sign of the observed statistic, the analyst declares significance whenever \(T\ge c\) or \(T\le -c\). By symmetry, each event has probability \(\alpha\), and the events do not overlap. Therefore,

$$ P(T\ge c\text{ or }T\le -c\mid H_0) =\alpha+\alpha=2\alpha. $$

For example, at a nominal \(\alpha=0.05\), selecting whichever one-sided result looks more favorable after seeing the sign gives a false-positive probability of \(0.10\) in this simple setting, not \(0.05\). More generally, the selected one-sided p-value is the smaller tail probability, and under the null it is twice as likely to fall below a given cutoff up to \(0.5\). The reported p-value no longer has the advertised calibration for a prespecified one-sided test.

This argument assumes the only data-dependent choice is which tail to use. In a real analysis, other unplanned choices can also affect error rates. The central principle remains: a test’s p-value is meaningful only relative to the analysis procedure that was actually planned and carried out.

Worked Example: The Temptation to Reverse the Test

Suppose a hypothetical study examines whether a predictor is associated with a response, without a credible prior reason to expect either direction. The analyst therefore plans a two-sided test of \(H_0:\beta_1=0\) against \(H_a:\beta_1\ne0\). The regression conditions are assumed to be reasonably supported. The study has \(n=19\), and the output gives \(b_1=0.70\) response units per predictor unit and \(SE(b_1)=0.35\) response units per predictor unit.

The observed statistic is

$$ t=\frac{0.70-0}{0.35}=2.00,\qquad df=19-2=17. $$

The planned two-sided p-value is \(P(|T_{17}|\ge2.00)\), approximately \(0.062\). At \(\alpha=0.05\), this result does not lead to rejection of \(H_0\). If the analyst instead notices that the slope is positive and reports the right-sided p-value, approximately \(0.031\), that does not rescue the result: the positive direction was not chosen before the estimate was seen. Selecting whichever tail matched the observed sign is a different procedure with a larger false-positive rate.

The appropriate report retains the planned two-sided test and its p-value. The positive estimated slope can still be described, with units, as the sample estimate. It should not be used to rewrite the original research question after the fact.

A Practical Decision Process

Before fitting or inspecting the regression results, write down the population slope being tested, the null value, and the alternative. Then check that the direction in the alternative genuinely matches the scientific question. The following sequence keeps the decision explicit.

1
Specify the target.
Name the population slope \(\beta_1\) and the null value \(\beta_{1,0}\) being tested.
2
Translate the research question.
Use \(H_a:\beta_1>\beta_{1,0}\) for a justified increase, \(H_a:\beta_1<\beta_{1,0}\) for a justified decrease, or \(H_a:\beta_1\ne\beta_{1,0}\) when either direction matters.
3
Fix the choice before seeing the result.
Record the hypotheses and significance level before examining the estimated slope, its test statistic, or its p-value.
4
Use the matching tail.
Calculate the slope t statistic and use the probability in the prespecified tail or tails under the null t distribution with \(n-2\) degrees of freedom.
5
Report the result in context.
State the alternative, test result, and slope units. If the estimate points in the opposite direction to a prespecified one-sided alternative, report that direction honestly rather than switching tails.

Common Mistake and Key Takeaway

Wrong reasoning: “The estimated slope is positive, so I will use a right-sided test. Its p-value is below 0.05, so the association is significant.” This reasoning uses the same data both to choose the direction and to evaluate evidence in that direction. It ignores the chance of seeing an equally extreme result in the negative direction and then selecting that tail instead.

Correction: Choose the alternative from the research question before examining the slope estimate. When the direction was not specified in advance or either sign matters, use a two-sided alternative. If a direction was genuinely specified in advance but the estimate points the other way, do not reverse the test; report that the result does not support the prespecified directional claim and describe the estimate accurately.

Key takeaway: The alternative hypothesis is part of the analysis plan, not a choice made to fit the data. A one-sided p-value is calibrated for a direction fixed in advance; selecting the favorable direction after seeing the slope can double the false-positive rate in the simple two-direction setting.

Check Your Understanding

Use the research question, not an observed slope, to answer each item.

  1. A study asks whether the population slope differs from zero in either direction. Write the alternative hypothesis and explain why a one-sided alternative would not match the question.
  2. For a prespecified left-sided test, the estimated slope is positive. Should the analyst switch to a right-sided test? Explain what the prespecified test says about this result.
  3. Under a symmetric null t distribution, explain why choosing the tail to match the observed sign gives a false-positive probability of \(2\alpha\) when the nominal one-sided level is \(\alpha\le0.5\).
  4. A test has \(n=16\), \(b_1=-0.60\), \(SE(b_1)=0.25\), and \(H_a:\beta_1<0\). Calculate the t statistic and degrees of freedom. Which tail determines the p-value?
  5. Give one reason a researcher might choose a one-sided alternative in advance, and one limitation of interpreting its result.