Tutorials › Regression Analysis (Undergraduate) › Test a Conditional Slope Against a Scientific Benchmark

Quantitative Predictor Interactions · Tutorial 334 of 991

Test a Conditional Slope Against a Scientific Benchmark

Learn to test a conditional slope against a meaningful benchmark using a linear contrast and its uncertainty.

Intermediate 10 min read

What You'll Learn

  • Express the slope at a chosen value of the other predictor as a linear contrast.
  • Form null and alternative hypotheses for a scientific benchmark.
  • Calculate a contrast’s standard error using coefficient variances and covariance.
  • Compute and interpret the appropriate t statistic and p-value.
  • Distinguish a test of a conditional slope from a test of whether predictors interact.

Why Test a Conditional Slope?

An interaction model allows the relationship between one quantitative predictor and an outcome to change with the value of another predictor. Sometimes the scientific question is more specific than whether that slope changes at all: at a particular value of the second predictor, is the slope equal to a benchmark suggested by a theory, standard, or practical target? For example, a researcher might ask whether an additional hour of practice is associated with a specified increase in performance among people with a particular amount of prior preparation.

This question is not generally answered by testing the interaction coefficient alone. It concerns the slope at a chosen value of the other predictor, which combines a main-effect coefficient and the product-term coefficient. The test must account for the uncertainty and covariance of both estimated coefficients.

Model and Hypotheses

Let \(Y\) be a quantitative outcome, \(X_1\) the predictor whose slope is of interest, and \(X_2\) the other quantitative predictor. The interaction model is

$$ Y_i=\beta_0+\beta_1X_{1i}+\beta_2X_{2i}+\beta_3X_{1i}X_{2i}+\varepsilon_i. $$

Here \(\beta_0,\beta_1,\beta_2,\beta_3\) are population coefficients and \(\varepsilon_i\) is the error for observation \(i\). The model assumes that the conditional mean of \(Y_i\), given the two predictors, has the displayed form. For the usual exact coefficient t tests, errors are independent, have mean zero and constant variance \(\sigma^2\), and are normally distributed. In particular, conditional on the predictor values, \(\varepsilon_i\sim N(0,\sigma^2)\). The predictors must also provide enough variation to estimate the model coefficients without exact linear dependence among the model terms.

At a fixed value \(X_2=c\), the part of the conditional mean that changes with \(X_1\) is \((\beta_1+c\beta_3)X_1\). Thus the slope of the conditional mean with respect to \(X_1\) at \(X_2=c\) is \(\beta_1+c\beta_3\). Suppose the scientific benchmark is \(m\) units of \(Y\) per unit of \(X_1\). The test asks whether this conditional slope equals \(m\).

Definition: The conditional-slope contrast for the slope of \(X_1\) at \(X_2=c\), relative to benchmark \(m\), is \(L=\beta_1+c\beta_3-m\). Its estimate is \(\hat{L}=b_1+cb_3-m\), where \(b_1\) and \(b_3\) are the fitted estimates of \(\beta_1\) and \(\beta_3\). The null hypothesis is \(H_0:\beta_1+c\beta_3=m\). A two-sided alternative is \(H_a:\beta_1+c\beta_3\ne m\); a scientifically justified directional question can instead use \(H_a:\beta_1+c\beta_3>m\) or \(H_a:\beta_1+c\beta_3<m\).

The value \(c\) must be stated in the units of \(X_2\), and \(m\) must use the slope’s units: units of \(Y\) per unit of \(X_1\). The chosen \(c\) defines which conditional slope is being tested. A test of \(\beta_3=0\), by contrast, asks whether the \(X_1\) slope changes with \(X_2\). These are different hypotheses.

Standard Error and Test Statistic

The estimate of the conditional slope is \(b_1+cb_3\). Its uncertainty depends on the estimated variances of \(b_1\) and \(b_3\), and on their covariance. The covariance matters because the two coefficient estimates generally are not independent.

$$ SE(b_1+cb_3)= \sqrt{\operatorname{Var}(b_1)+c^2\operatorname{Var}(b_3)+2c\operatorname{Cov}(b_1,b_3)}. $$

In this expression, \(\operatorname{Var}(b_1)\), \(\operatorname{Var}(b_3)\), and \(\operatorname{Cov}(b_1,b_3)\) are estimated from the fitted model’s coefficient covariance matrix. Subtracting the fixed benchmark \(m\) does not change the standard error, so \(SE(\hat{L})=SE(b_1+cb_3)\).

The test statistic compares the estimated contrast with its null value, zero, in standard-error units. Under the stated regression assumptions and \(H_0\), it follows a t distribution with the model’s residual degrees of freedom, denoted \(df\).

$$ t=\frac{b_1+cb_3-m}{SE(b_1+cb_3)}. $$

For a two-sided alternative, the p-value is the probability, under \(H_0\), of a t statistic at least as far from zero as the observed \(t\), in either direction. For a greater-than alternative, it is the upper-tail probability; for a less-than alternative, it is the lower-tail probability. Compare the p-value with the prespecified significance level \(\alpha\). A small p-value is evidence against the benchmark hypothesis, not the probability that \(H_0\) is true.

Why the Covariance Term Appears

The standard error follows from the variance rule for a linear combination. For random quantities \(A\) and \(B\), the variance of \(A+cB\) includes a covariance term. Applying that rule to the coefficient estimates gives

$$ \begin{aligned} \operatorname{Var}(b_1+cb_3) &=\operatorname{Var}(b_1)+\operatorname{Var}(cb_3) +2\operatorname{Cov}(b_1,cb_3)\\ &=\operatorname{Var}(b_1)+c^2\operatorname{Var}(b_3) +2c\operatorname{Cov}(b_1,b_3). \end{aligned} $$

The second equality uses \(\operatorname{Var}(cB)=c^2\operatorname{Var}(B)\) and \(\operatorname{Cov}(A,cB)=c\operatorname{Cov}(A,B)\). Taking the square root gives the standard error. If \(c\) is negative, the covariance contribution changes sign as well; it cannot be dropped or replaced by a sum of separate standard errors.

For the usual t reference distribution, the model’s coefficient estimates are linear combinations of normally distributed errors. Under the null, the contrast estimate minus its null value, divided by its true standard deviation, is standard normal. Replacing the unknown error variance with its residual estimate introduces the t distribution with residual \(df\). This is why the t test uses the full contrast standard error rather than treating the two coefficient estimates as unrelated.

Worked Example: Testing a Slope Against a Two-Sided Benchmark

Suppose a hypothetical model predicts a performance score \(Y\) from practice hours \(X_1\) and prior-preparation score \(X_2\), including their product. At \(X_2=4\), investigators want to test whether the practice slope is \(2.0\) score points per practice hour. The fitted estimates are \(b_1=1.20\) and \(b_3=0.35\), with \(\operatorname{Var}(b_1)=0.0900\), \(\operatorname{Var}(b_3)=0.0064\), and \(\operatorname{Cov}(b_1,b_3)=-0.0120\). The residual degrees of freedom are 36, and use \(\alpha=0.05\).

Assume the linear conditional-mean form is appropriate, observations are independent, and residual checks for this hypothetical example support a mean-zero, constant-variance, approximately normal error model. Also assume the predictor terms are estimable. These conditions make the usual t inference appropriate.

The estimated practice slope at prior-preparation score 4 is

$$ b_1+4b_3=1.20+4(0.35)=2.60 $$

score points per practice hour. The hypotheses are \(H_0:\beta_1+4\beta_3=2.0\) and \(H_a:\beta_1+4\beta_3\ne2.0\). Calculate the standard error using the covariance term:

$$ \begin{aligned} SE(b_1+4b_3) &=\sqrt{0.0900+4^2(0.0064)+2(4)(-0.0120)}\\ &=\sqrt{0.0900+0.1024-0.0960}\\ &=\sqrt{0.0964}=0.3105. \end{aligned} $$

The test statistic is

$$ t=\frac{2.60-2.00}{0.3105}=1.93,\qquad df=36. $$

The two-sided p-value is approximately 0.061. Since \(0.061>0.05\), the test does not reject \(H_0\) at the 5% level. The data do not provide sufficient evidence that the practice slope at preparation score 4 differs from 2.0 score points per hour. This does not establish that the slope equals 2.0.

Worked Example: Testing a Directional Benchmark

In another hypothetical analysis, \(Y\) is a measured outcome, \(X_1\) is a dosage in milligrams, and \(X_2\) is a baseline score. At \(X_2=2\), the scientific question is whether the outcome’s dosage slope exceeds \(1.2\) outcome units per milligram. The estimates are \(b_1=1.00\), \(b_3=0.40\), \(\operatorname{Var}(b_1)=0.0400\), \(\operatorname{Var}(b_3)=0.0100\), and \(\operatorname{Cov}(b_1,b_3)=0.0040\); \(df=28\). Use \(\alpha=0.05\).

Suppose the model form and independence, mean-zero, constant-variance, and approximate-normality conditions are reasonable based on the hypothetical design and residual checks, and the model terms are estimable. Because the scientific question is directional, use \(H_0:\beta_1+2\beta_3=1.2\) against \(H_a:\beta_1+2\beta_3>1.2\).

The estimated conditional slope is \(1.00+2(0.40)=1.80\) outcome units per milligram. Its standard error and test statistic are

$$ \begin{aligned} SE(b_1+2b_3) &=\sqrt{0.0400+2^2(0.0100)+2(2)(0.0040)}\\ &=\sqrt{0.0960}=0.3098,\\ t&=\frac{1.80-1.20}{0.3098}=1.94,\qquad df=28. \end{aligned} $$

The upper-tail p-value is approximately 0.031. Since this is below 0.05, reject \(H_0\) in favor of the greater-than alternative. The hypothetical results provide evidence that at baseline score 2, the dosage slope exceeds 1.2 outcome units per milligram. The one-sided alternative is appropriate only because the scientific question was directional before examining these results.

Worked Example: A Negative Chosen Value

Consider a hypothetical model relating an outcome \(Y\) to \(X_1\) and \(X_2\). At \(X_2=-3\), the benchmark for the \(X_1\) slope is \(1.0\) outcome unit per unit of \(X_1\). Suppose \(b_1=0.60\), \(b_3=-0.20\), \(\operatorname{Var}(b_1)=0.0625\), \(\operatorname{Var}(b_3)=0.0025\), and \(\operatorname{Cov}(b_1,b_3)=0.0060\), with \(df=41\). Use a two-sided test at \(\alpha=0.05\).

Assume the specified model is suitable, the errors meet the independence, mean-zero, constant-variance, and approximate-normality conditions, and there is sufficient predictor variation to estimate the coefficients. The estimated conditional slope is \(0.60+(-3)(-0.20)=1.20\). Its standard error is

$$ \begin{aligned} SE(b_1-3b_3) &=\sqrt{0.0625+(-3)^2(0.0025)+2(-3)(0.0060)}\\ &=\sqrt{0.0625+0.0225-0.0360}\\ &=\sqrt{0.0490}=0.2214. \end{aligned} $$

Thus \(t=(1.20-1.00)/0.2214=0.90\), with \(df=41\). The two-sided p-value is approximately 0.372, so the test does not reject \(H_0:\beta_1-3\beta_3=1.0\) at the 5% level. The estimated slope is 1.20 units per unit of \(X_1\), but the result does not provide strong evidence that it differs from the benchmark. Notice that the negative \(c\) makes the covariance contribution negative here.

Common Mistakes and Interpretation

  • Testing only the interaction coefficient. Testing \(\beta_3=0\) asks whether the slope changes with \(X_2\); it does not test whether the slope at a specified \(c\) equals \(m\). Use \(H_0:\beta_1+c\beta_3=m\) for the benchmark question.
  • Ignoring coefficient covariance. Adding variances alone is incorrect unless the covariance is zero. Use the complete variance expression, including \(2c\operatorname{Cov}(b_1,b_3)\).
  • Using the wrong value or units for \(c\). The chosen value must be on the scale used to fit \(X_2\). If \(X_2\) was centered or rescaled, express \(c\) on that scale.
  • Calling a non-significant result proof of equality. Failure to reject means the data did not give sufficient evidence against the specified benchmark at the chosen level. It does not prove that the true conditional slope equals the benchmark.
  • Choosing a one-sided test after seeing the estimate. The direction must follow the scientific question, not the observed sign; otherwise the reported p-value is not justified as a prespecified directional test.

A well-reported result names the outcome, predictor, chosen value \(c\), benchmark \(m\), estimated conditional slope, uncertainty test, and units. For example: “At baseline score 2, the estimated dosage slope was 1.80 outcome units per milligram; a one-sided test provided evidence that it exceeded the benchmark of 1.2 units per milligram (\(t=1.94\), \(df=28\), \(p\approx0.031\)).” This gives the scientific meaning as well as the statistical decision.

Check Your Understanding

Answer each question using the model and testing logic developed above.

  1. In the interaction model, write the conditional slope of \(X_1\) at \(X_2=c\). What linear null hypothesis tests whether it equals benchmark \(m\)?
  2. Why does the standard error of \(b_1+cb_3\) include a covariance term? What happens to the multiplier of that term when \(c\) is negative?
  3. Explain why testing \(\beta_3=0\) is not the same as testing whether the slope at \(X_2=5\) equals a specified benchmark.
  4. A two-sided test returns \(p=0.08\) at \(\alpha=0.05\). State the conclusion accurately, and explain why it does not establish equality with the benchmark.
  5. What units should be used for a conditional slope benchmark, and which scale must be used for the selected value \(c\)?