Tutorials › Exam SRM - Statistics for Risk Modeling › Interpreting Interactions Through Conditional Slopes

Exam SRM · Regression and Selection Cases · Tutorial 847 of 926

Interpreting Interactions Through Conditional Slopes

Interpret interaction coefficients as conditional slopes, quantify their uncertainty, and decide whether an interaction adds explanatory value.

Advanced 10 min read

What You'll Learn

  • Write the conditional mean and identify the interaction coefficient.
  • Calculate the slope of one predictor at a specified value of the other.
  • Find the standard error of a conditional slope using coefficient variances and covariance.
  • Test an interaction by comparing nested regression models.
  • Distinguish evidence of an interaction from a change in the model’s overall fit.
  • Avoid interpreting a main-effect coefficient without its reference covariate value.

Why Conditional Slopes Matter

In a regression model without an interaction, the slope for one predictor is constant across values of the other predictors. An interaction allows that slope to vary. This matters when, for example, the association between a risk score and an outcome may differ by exposure level. The model can describe that variation, but an interaction by itself does not establish a causal relationship.

This tutorial focuses on interactions between two continuous predictors in ordinary least squares regression. It shows how to interpret slopes at specified covariate values, calculate their uncertainty, and test whether adding the interaction improves fit. These methods are aligned with the SOA Exam SRM (Statistics for Risk Modeling) syllabus.

Definition: A continuous-predictor interaction is represented by the product of two continuous predictors in a regression model. With response \(Y\), predictors \(X\) and \(Z\), and independent errors, the model is
$$ Y_i=\beta_0+\beta_1X_i+\beta_2Z_i+\beta_3X_iZ_i+\varepsilon_i. $$
Here, \(\beta_3\) describes how the slope for one predictor changes as the other predictor increases by one unit. Under the usual linear-model assumptions, the errors have mean zero, common variance \(\sigma^2\), and a normal distribution for exact small-sample inference.

Reading the Coefficients as Conditional Slopes

The coefficient \(\beta_1\) is not generally the slope for \(X\) at every value of \(Z\). Holding \(Z=z\) fixed, collect the terms involving \(X\):

$$ E[Y\mid X,Z=z] =(\beta_0+\beta_2z)+(\beta_1+\beta_3z)X. $$

This is a straight line in \(X\) at the chosen value \(z\). Therefore, its slope is \(\beta_1+\beta_3z\). By the same reasoning, holding \(X=x\) fixed gives a slope for \(Z\) of \(\beta_2+\beta_3x\).

Key result: In the model with interaction \(XZ\), the conditional slope for \(X\) at \(Z=z\) is \(\beta_1+\beta_3z\). The conditional slope for \(Z\) at \(X=x\) is \(\beta_2+\beta_3x\). A main-effect coefficient is the slope when the other predictor equals zero.

The value zero must have a meaningful interpretation. If zero is outside the useful range of a predictor, the corresponding main-effect coefficient may be difficult to explain. Centering a predictor can make the reference value more useful: replacing \(Z\) with \(Z_c=Z-c\) makes the \(X\) main-effect coefficient the slope when the original \(Z=c\). Centering changes the coefficient interpretations, but it does not change fitted values when the model is re-expressed correctly.

The interaction coefficient also has a direct interpretation. If \(\beta_3\) is positive, the slope for \(X\) increases by \(\beta_3\) for each one-unit increase in \(Z\); if it is negative, that slope decreases. This describes a change in slope, not necessarily a positive or negative association at every value of \(Z\).

Worked Example: A Slope at a Specified Covariate Value

A hypothetical insurer models annual claim cost \(Y\), in thousands of dollars, using a prevention score \(X\) and years of policy tenure \(Z\). The fitted conditional mean is

$$ \widehat{E}[Y\mid X,Z]=12-0.5X+0.08Z+0.02XZ. $$

Find the slope for prevention score at ten years of tenure, the slope for tenure at a prevention score of ten, and the fitted mean at \(X=10,\ Z=5\). Interpret the interaction.

Method. Use the conditional-slope formulas, then substitute the requested predictor values into the fitted mean.

At \(Z=10\), the slope for \(X\) is

$$ -0.5+(0.02)(10)=-0.5+0.2=-0.3. $$

Thus, at ten years of tenure, a one-point increase in prevention score is associated with a fitted decrease of \(0.3\) thousand dollars, or \$300, in annual claim cost, holding tenure fixed.

At \(X=10\), the slope for \(Z\) is

$$ 0.08+(0.02)(10)=0.08+0.2=0.28. $$

That is a fitted increase of \(0.28\) thousand dollars, or \$280, per additional year of tenure at a prevention score of ten.

At \(X=10,\ Z=5\), the fitted mean is

$$ 12-0.5(10)+0.08(5)+0.02(10)(5) =12-5+0.4+1=8.4. $$

The fitted mean is \$8,400. The positive interaction coefficient means that the slope for prevention score increases by \(0.02\) thousand dollars per score point for each additional year of tenure. At ten years, the slope is still negative, as calculated above.

Common mistake avoided: Reporting \(-0.5\) as the prevention-score slope at every tenure value ignores the interaction. It is the slope only at \(Z=0\).

Uncertainty in a Conditional Slope

An estimated conditional slope combines coefficient estimates. Its standard error must therefore account for the uncertainty in both estimates and their covariance. For a fitted model, let \(\widehat{\beta}_1\) and \(\widehat{\beta}_3\) be coefficient estimates. At \(Z=z\), the estimated slope is \(\widehat{\beta}_1+z\widehat{\beta}_3\), and its variance is

$$ \operatorname{Var}(\widehat{\beta}_1+z\widehat{\beta}_3) =\operatorname{Var}(\widehat{\beta}_1) +z^2\operatorname{Var}(\widehat{\beta}_3) +2z\operatorname{Cov}(\widehat{\beta}_1,\widehat{\beta}_3). $$

This follows from the variance rule \(\operatorname{Var}(A+B)=\operatorname{Var}(A)+\operatorname{Var}(B)+2\operatorname{Cov}(A,B)\), with \(A=\widehat{\beta}_1\) and \(B=z\widehat{\beta}_3\). Because \(z\) is fixed, \(\operatorname{Var}(z\widehat{\beta}_3)=z^2\operatorname{Var}(\widehat{\beta}_3)\), and \(\operatorname{Cov}(\widehat{\beta}_1,z\widehat{\beta}_3)=z\operatorname{Cov}(\widehat{\beta}_1,\widehat{\beta}_3)\).

Under the normal-error linear model, a confidence interval for this one linear combination uses a \(t\) critical value and the residual degrees of freedom. A coefficient table’s individual standard errors are not enough to calculate the conditional-slope standard error: the covariance between the estimates is also needed.

Worked Example: Standard Error and Interval for a Conditional Slope

In a hypothetical regression, the estimated coefficients for \(X\) and \(XZ\) are \(\widehat{\beta}_1=0.4\) and \(\widehat{\beta}_3=0.2\). Their estimated variances are \(0.25\) and \(0.04\), respectively, and their covariance is \(-0.02\). At \(Z=2\), calculate the estimated slope, its standard error, and a 95% confidence interval. Assume the model has 20 residual degrees of freedom and use \(t_{0.975,20}=2.086\).

Method. First calculate the conditional slope, then use the variance of a linear combination. Keep unrounded values until the interval endpoints are calculated.

The estimated slope at \(Z=2\) is

$$ \widehat{\beta}_1+2\widehat{\beta}_3 =0.4+2(0.2)=0.8. $$

Its estimated variance is

$$ 0.25+2^2(0.04)+2(2)(-0.02) =0.25+0.16-0.08=0.33. $$

Therefore, the standard error is \(\sqrt{0.33}=0.574456\ldots\). The 95% confidence interval is

$$ 0.8\mathbin{\pm}2.086\sqrt{0.33} =0.8\mathbin{\pm}1.198316\ldots =(-0.398316\ldots,\ 1.998316\ldots). $$

Rounded to four decimals at the final step, the interval is \((-0.3983,\ 1.9983)\). Since it includes zero, these results do not show that the conditional slope differs from zero at the 5% two-sided level.

Common mistake avoided: Omitting the covariance term would give the wrong variance. Here the covariance contribution is \(2(2)(-0.02)=-0.08\); it is not zero and must be included.

Testing Whether the Interaction Improves Fit

To test whether the interaction contributes to the model, compare a full model containing the product \(XZ\) with a reduced model that retains both main effects but omits the product. The null hypothesis is \(H_0:\beta_3=0\); the alternative is \(H_A:\beta_3\ne0\). Retaining both main effects is important: the comparison asks whether the interaction adds information beyond the two predictors’ separate linear effects.

The models must use the same response and observations, and the reduced model must be nested in the full model. Under the usual linear-model assumptions, if the full model has \(p_F\) estimated parameters including the intercept and the two models differ by \(q\) parameters, the partial F statistic is

$$ F= \frac{(SSE_R-SSE_F)/q}{SSE_F/(n-p_F)}. $$

Here \(SSE_R\) and \(SSE_F\) are the residual sums of squares for the reduced and full models, and \(n\) is the sample size. Under the null hypothesis and the model assumptions, this statistic has an \(F\) distribution with \(q\) and \(n-p_F\) degrees of freedom.

The numerator measures the reduction in residual sum of squares per added parameter. The denominator is the full model’s residual mean square. Under the null, both quantities estimate the same error variance, so their ratio should not usually be large. A large value is evidence against the null. For a single interaction coefficient, \(q=1\); the partial F test is equivalent to squaring the usual \(t\) statistic for that coefficient.

Worked Example: Nested-Model Test for an Interaction

A hypothetical study fits a reduced regression with two continuous predictors and an intercept, then a full regression that adds their interaction. Both models use the same 32 observations. The reduced-model residual sum of squares is \(80\), and the full-model residual sum of squares is \(56\). Test the interaction at the 5% level. The full model has four parameters including its intercept.

Method. Apply the partial F test. The models differ by the single interaction coefficient, so \(q=1\), and the full-model residual degrees of freedom are \(32-4=28\).

The numerator mean square for the added term is

$$ \frac{80-56}{1}=24. $$

The full-model residual mean square is

$$ \frac{56}{28}=2. $$

Thus,

$$ F=\frac{24}{2}=12, $$

with 1 and 28 degrees of freedom. The 5% critical value is approximately \(4.20\), and \(12>4.20\). Reject \(H_0\) at the 5% level: adding the interaction improves fit in this comparison.

Common mistake avoided: Comparing the full model with a model that omits one of the main effects as well as the interaction would not isolate the interaction’s contribution. The reduced model here retains both main effects.

Interpret the Test Alongside the Slopes

A significant nested-model test is evidence that the interaction coefficient is not zero under the stated model; it does not say that the conditional slope is positive at every covariate value, that the effect is practically large, or that the relationship is causal. Conversely, a slope at one particular \(Z=z\) may be estimated imprecisely even when the interaction test is significant. The test concerns change in slope across values of \(Z\); a conditional-slope test concerns the slope at one specified value.

Before interpreting results, check the units and range of both predictors. A one-unit change might mean one year, one percentage point, or a much larger scale change. Slopes should be reported with those units, and predictions at covariate combinations far outside the observed data range should be treated cautiously.

1
State the model.
Confirm that the product term is present and identify which variable is held fixed.
2
Substitute the specified value.
For the slope of \(X\), calculate \(\widehat{\beta}_1+z\widehat{\beta}_3\).
3
Quantify uncertainty if requested.
Use both coefficient variances and their covariance to find the slope’s standard error.
4
Test added fit with nested models.
Keep the main effects in the reduced model, calculate the partial F statistic, and compare it with the appropriate reference distribution.

Common Exam Traps

  • Reading a main effect as a universal slope. In an interaction model, \(\beta_1\) is the slope for \(X\) only when \(Z=0\).
  • Leaving out the product’s contribution. At \(Z=z\), the \(X\) slope includes \(z\beta_3\), with the sign determined by the estimated interaction coefficient.
  • Dropping the covariance term. A linear combination’s variance includes twice the covariance contribution; it may increase or decrease the result.
  • Using the wrong reduced model. To test the interaction alone, retain the two main effects and remove only the interaction term.
  • Confusing fit with practical importance. A statistically detectable improvement does not by itself establish a large or useful effect.
Key takeaway: An interaction makes a predictor’s slope conditional on the other predictor. Calculate that slope at the value specified, use the full variance of the coefficient combination for inference, and use a nested-model comparison to assess the interaction’s contribution to fit.

Check Your Understanding

For each problem, identify the requested conditional effect or model comparison before calculating.

  1. A fitted model is \(\widehat{Y}=4+1.2X-0.4Z+0.06XZ\). Find the slope for \(X\) at \(Z=8\), and state how much that slope changes when \(Z\) rises from 3 to 8. (Answer: slope \(1.68\); increase \(0.30\).)
  2. At \(Z=4\), the estimates for \(\beta_1\) and \(\beta_3\) have variances \(0.09\) and \(0.01\), and covariance \(0.015\). Find the standard error of the estimated \(X\) slope. (Answer: variance \(0.37\); standard error \(\sqrt{0.37}\approx0.6083\).)
  3. A reduced model retains two main effects; the full model adds their single interaction. With \(n=25\), \(SSE_R=142\), \(SSE_F=118\), and five full-model parameters, calculate the partial F statistic and decide at 5%, using critical value \(4.35\). (Answer: \(F=24/(118/20)\approx4.0678\); do not reject at 5%.)
  4. A fitted model uses \(Z_c=Z-10\) and has coefficients \(\widehat{\beta}_1=0.7\) and \(\widehat{\beta}_3=-0.05\). Find the slope for \(X\) at original \(Z=14\), and state the \(X\) slope at the centering value. (Answer: at \(Z=14\), \(0.7-0.05(4)=0.50\); at \(Z=10\), \(0.70\).)
  5. For a one-parameter interaction test, the reduced and full residual sums of squares are \(210\) and \(174\). If \(n=40\) and the full model has four parameters, calculate \(F\) and compare with the 5% critical value \(4.11\). (Answer: \(F=36/(174/36)\approx7.4483\); reject the null at 5%.)
Clinical Biostats