Why a Conditional Slope Needs an Interval
In a regression model with an interaction between two quantitative predictors, the slope for one predictor depends on the value of the other. A fitted slope is an estimate: a different sample could produce a different value. A confidence interval combines the estimated conditional slope with its sampling uncertainty, so we can assess which slope values are reasonably compatible with the data and model.
The interval must account for the uncertainty in both coefficients that make up the conditional slope, including their covariance. Using only the standard error of either coefficient, or treating the two coefficient estimates as independent, can give the wrong result.
Model and Conditional Slope
Let \(x_1\) and \(x_2\) be quantitative predictors and \(Y\) the response. For observation \(i\), consider the interaction model
The coefficient vector is \(\boldsymbol{\beta}=(\beta_0,\beta_1,\beta_2,\beta_3)^\mathsf{T}\), and its least-squares estimate is \(\mathbf{b}=(b_0,b_1,b_2,b_3)^\mathsf{T}\). At a specified value \(x_2=c\), the conditional slope of the mean response with respect to \(x_1\) is \(\beta_1+c\beta_3\). Its estimate is \(b_1+cb_3\). The slope’s units are response units per unit of \(x_1\); \(c\) is expressed in the units of \(x_2\).
The assumptions for the exact interval used here are those of the classical normal-error linear model: the predictors are treated as fixed, the model is linear in its coefficients and correctly specified, the errors are independent with mean zero and common variance \(\sigma^2\), and the errors are normally distributed. The design matrix must have full column rank so all four coefficients are estimable. In practice, the study design should support independence, the fitted relationship should be reasonably represented by the model, and residual checks should not show strong evidence of nonconstant variance or severe departures from normality. The exact t-based coverage relies on these assumptions.
Formula and Justification
Write \(\widehat{\operatorname{Cov}}(\mathbf{b})\) for the estimated covariance matrix of the four coefficient estimates, in the order \(b_0,b_1,b_2,b_3\). It is commonly reported by regression software. The estimated variance of the conditional slope uses the entries for \(b_1\) and \(b_3\):
The estimated standard error is the square root of this quantity. The covariance term matters because the two coefficient estimates generally vary together across samples. It can increase or decrease the estimated variance depending on its sign and on \(c\).
Here is why the t critical value is appropriate. Let \(X\) be the design matrix, whose columns correspond to the intercept, \(x_1\), \(x_2\), and \(x_1x_2\). For a fixed \(c\), set \(\mathbf{a}=(0,1,0,c)^\mathsf{T}\); then the conditional slope and its estimate are \(\mathbf{a}^\mathsf{T}\boldsymbol{\beta}\) and \(\mathbf{a}^\mathsf{T}\mathbf{b}\). Under the normal-error model, the estimated coefficient vector is normally distributed with its true covariance matrix \(\sigma^2(X^\mathsf{T}X)^{-1}\). Thus the linear combination is normal with true sampling variance \(\sigma^2\mathbf{a}^\mathsf{T}(X^\mathsf{T}X)^{-1}\mathbf{a}\). This is not the same as saying it is normal with the estimated variance.
Estimate \(\sigma^2\) by the residual mean square \(s^2\), where \(s\) is the residual standard deviation and \(df=n-4\). Substitution gives the estimated covariance matrix \(s^2(X^\mathsf{T}X)^{-1}\), and hence the estimated standard error \(SE\) of the linear combination. Under the model assumptions, the residual sum of squares divided by \(\sigma^2\) has a chi-square distribution with \(n-4\) degrees of freedom and is independent of the coefficient estimates. Therefore, dividing the estimation error by its estimated standard error produces a t statistic with \(n-4\) degrees of freedom. Inverting that t statistic gives the interval:
where \(t^*_{n-4}\) is the positive t critical value for the desired two-sided confidence level. For a 95% interval, the critical value cuts off 2.5% in each tail of the t distribution.
Worked Example: Slope at a Specified Preparation Level
Suppose a hypothetical study models a test score \(Y\) using study hours \(x_1\) and prior-preparation score \(x_2\), with the interaction model above. The fitted coefficients are \(b_1=2.40\) score points per study hour and \(b_3=-0.30\) score points per study hour per preparation-score point. At \(x_2=4\), construct a 95% confidence interval for the conditional study-hours slope.
Suppose there are \(n=30\) independent observations, the four design columns are linearly independent, and residual checks for this hypothetical fit show no notable curvature or changing spread and are reasonably consistent with normal errors. These conditions support using the stated t procedure. The relevant estimated covariance entries are \(\widehat{\operatorname{Var}}(b_1)=0.160\), \(\widehat{\operatorname{Var}}(b_3)=0.0100\), and \(\widehat{\operatorname{Cov}}(b_1,b_3)=-0.0150\).
First, the estimated conditional slope at \(x_2=4\) is
Its estimated variance and standard error are
The residual degrees of freedom are \(30-4=26\), and \(t^*_{26}\) for 95% confidence is approximately 2.056. Therefore,
Under the model assumptions, this procedure has 95% coverage for the true study-hours slope when prior-preparation score is 4. In context, the interval estimates an increase of about 0.281 to 2.119 score points in mean test score per additional study hour for students at that preparation score. It does not establish that study hours cause a score increase.
More Conditional-Slope Intervals
Worked Example: A Negative Covariance at a Higher Predictor Value
In a separate hypothetical model, let \(x_1\) be treatment duration in hours, \(x_2\) be a baseline measurement, and \(Y\) be an outcome measured in points. Suppose \(b_1=1.10\) points per treatment hour and \(b_3=0.45\) points per treatment hour per baseline-measurement unit. At \(x_2=3\), the estimated conditional slope is
Suppose \(n=22\), the design has full rank, independent observations are justified by the hypothetical sampling plan, and residual checks do not indicate a serious violation of the normal, constant-variance model. The relevant covariance entries are \(\widehat{\operatorname{Var}}(b_1)=0.0900\), \(\widehat{\operatorname{Var}}(b_3)=0.0225\), and \(\widehat{\operatorname{Cov}}(b_1,b_3)=-0.0120\). The estimated variance is
There are \(22-4=18\) residual degrees of freedom, so \(t^*_{18}\approx2.101\). The 95% interval is
For the hypothetical population represented by this model, the interval estimates a conditional slope between about 1.463 and 3.437 outcome points per additional treatment hour when the baseline measurement is 3 units. The negative covariance reduces the variance here relative to omitting the covariance term; it must still be included because it is part of the variance formula.
Worked Example: An Interval That Includes Zero
Consider another hypothetical model in which \(x_1\) is weekly practice time in hours, \(x_2\) is a standardized coaching measure, and \(Y\) is a performance score in points. Suppose the estimated coefficients are \(b_1=0.80\) points per practice hour and \(b_3=0.20\) points per practice hour per coaching-measure unit. We want the slope at \(x_2=-2\). Assume \(n=16\), a full-rank design, independent observations, and residual checks that are reasonably compatible with constant-variance normal errors.
Suppose the estimated covariance entries are \(\widehat{\operatorname{Var}}(b_1)=0.0400\), \(\widehat{\operatorname{Var}}(b_3)=0.0100\), and \(\widehat{\operatorname{Cov}}(b_1,b_3)=0.0100\). The estimated slope is
The estimated variance includes a negative contribution from the covariance term because \(c=-2\):
The residual degrees of freedom are \(16-4=12\), and \(t^*_{12}\approx2.179\). Thus the 95% interval is
The interval includes zero. In this hypothetical setting, the data and model do not rule out a zero conditional practice-time slope at coaching-measure value \(-2\) at the 95% confidence level. This does not prove that the slope is zero; it indicates that the interval also includes small negative and positive values.
Using and Interpreting the Interval
For each specified value \(c\), the interval targets one quantity, \(\beta_1+c\beta_3\). Changing \(c\) changes both the estimated slope and, generally, its standard error. A confidence interval at \(c=0\) is an interval for \(\beta_1\), because the product contribution is then zero. At a nonzero \(c\), the covariance between \(b_1\) and \(b_3\) contributes to the uncertainty.
The confidence level describes the long-run performance of the method: if the same sampling and analysis procedure were repeated many times under the model, 95% of intervals formed this way would contain the true conditional slope. It is not correct to say that, after calculating one interval, there is a 95% probability that the fixed parameter lies in it.
This is an interval for a slope, not an interval for the mean response at a particular predictor pair and not a prediction interval for an individual outcome. Its units are response units per unit of \(x_1\), and its interpretation is tied to the stated value of \(x_2\).
Common Mistake
A frequent error is to calculate the variance as \(\widehat{\operatorname{Var}}(b_1)+c^2\widehat{\operatorname{Var}}(b_3)\) and leave out \(2c\,\widehat{\operatorname{Cov}}(b_1,b_3)\). That calculation silently assumes the coefficient estimates have zero covariance. In an interaction model, that is not generally true. Use the relevant entries of the full coefficient covariance matrix, including the covariance term, before taking the square root.
A second error is to use a standard normal critical value automatically. When the residual variance is estimated and the normal-error model applies, use the t critical value with \(n-4\) residual degrees of freedom. The estimator’s true sampling variance involves \(\sigma^2\); replacing it with an estimate supplies an estimated standard error, and the studentized statistic—not the unstudentized estimator with that estimated variance—is t-distributed.
Check Your Understanding
Use the model assumptions and formulas above to answer these questions.
- In the interaction model, what parameter does the conditional-slope interval target when \(x_2=c\)?
- If \(\widehat{\operatorname{Var}}(b_1)=0.09\), \(\widehat{\operatorname{Var}}(b_3)=0.01\), and \(\widehat{\operatorname{Cov}}(b_1,b_3)=0.02\), what is the estimated variance of \(b_1+2b_3\)?
- Why can omitting the covariance term produce an incorrect standard error?
- For a model with 25 observations and four estimated coefficients, what residual degrees of freedom are used for the t critical value?
- Explain in context what it means for a 95% confidence interval for a conditional slope to include zero.