Tutorials › Exam SRM - Statistics for Risk Modeling › Reading Group-Specific Slopes from an Interaction

Exam SRM · Multiple Regression Estimation · Tutorial 49 of 926

Reading Group-Specific Slopes from an Interaction

Learn to translate a binary-by-continuous interaction model into a separate fitted line for each group and interpret the coefficients in context.

Intermediate 10 min read

What You'll Learn

  • Write the fitted model for a binary-by-continuous interaction.
  • Derive the fitted line for each value of the binary indicator.
  • Identify each group’s intercept and slope from the coefficients.
  • Interpret the interaction coefficient as the difference between group slopes.
  • Check slope and intercept interpretations by substituting the indicator values.
  • Recognize when an intercept is an extrapolation rather than a useful observed value.

From One Interaction Model to Two Group-Specific Lines

A binary-by-continuous interaction allows the fitted relationship between a quantitative predictor and a response to have different slopes in two groups. The model is written with one equation, but its meaning is often clearest when rewritten as a separate fitted line for each group. The key is to substitute each possible value of the binary indicator into the full equation before interpreting its coefficients.

This tutorial focuses on reading the group-specific intercepts and slopes from the model. The coefficients are treated as given fitted estimates; the algebra below does not require a distributional assumption or a test of whether the slopes differ. The interpretation does require attention to how the groups are coded and to the units of the continuous predictor.

Definition: Let \(Z\) be a binary indicator, coded \(Z=0\) for the reference group and \(Z=1\) for the other group. Let \(X\) be a continuous predictor and \(Y\) a response. A binary-by-continuous interaction model has fitted equation $$ \widehat{Y}=\hat{\beta}_0+\hat{\beta}_1X+\hat{\beta}_2Z+\hat{\beta}_3XZ. $$ For the \(Z=0\) group, the fitted intercept is \(\hat{\beta}_0\) and the fitted slope on \(X\) is \(\hat{\beta}_1\). For the \(Z=1\) group, the fitted intercept is \(\hat{\beta}_0+\hat{\beta}_2\) and the fitted slope on \(X\) is \(\hat{\beta}_1+\hat{\beta}_3\).

Here, \(\hat{\beta}_2\) is the difference between the groups’ fitted intercepts, and \(\hat{\beta}_3\) is the difference between their fitted slopes. In particular, \(\hat{\beta}_3\) is not the full slope for the \(Z=1\) group. It is the amount added to the reference-group slope to obtain that group’s slope.

Deriving the Two Lines

The result follows directly by evaluating the fitted equation at the two possible indicator values. When \(Z=0\), the terms containing \(Z\) or \(XZ\) are zero. When \(Z=1\), both terms remain, and the coefficients of the constant and \(X\) can be collected separately.

1
Set \(Z=0\).
Substitute into the model: \(\widehat{Y}=\hat{\beta}_0+\hat{\beta}_1X+\hat{\beta}_2(0)+\hat{\beta}_3X(0)=\hat{\beta}_0+\hat{\beta}_1X\). Thus the reference group has intercept \(\hat{\beta}_0\) and slope \(\hat{\beta}_1\).
2
Set \(Z=1\).
Substitute to obtain \(\widehat{Y}=\hat{\beta}_0+\hat{\beta}_1X+\hat{\beta}_2+\hat{\beta}_3X\).
3
Collect the constant and \(X\) terms.
Rearranging gives \(\widehat{Y}=(\hat{\beta}_0+\hat{\beta}_2)+(\hat{\beta}_1+\hat{\beta}_3)X\). The \(Z=1\) intercept is \(\hat{\beta}_0+\hat{\beta}_2\), and its slope is \(\hat{\beta}_1+\hat{\beta}_3\).

This substitution is also a useful check on the interpretation. At \(X=0\), the fitted values are \(\hat{\beta}_0\) and \(\hat{\beta}_0+\hat{\beta}_2\), so their difference is \(\hat{\beta}_2\). For a one-unit increase in \(X\), the fitted change in the reference group is \(\hat{\beta}_1\), while the fitted change in the \(Z=1\) group is \(\hat{\beta}_1+\hat{\beta}_3\). Subtracting those changes gives \(\hat{\beta}_3\).

$$ \begin{aligned} Z=0:\quad &\widehat{Y}=\hat{\beta}_0+\hat{\beta}_1X,\\ Z=1:\quad &\widehat{Y}=(\hat{\beta}_0+\hat{\beta}_2)+(\hat{\beta}_1+\hat{\beta}_3)X,\\ \text{difference in slopes:}\quad &(\hat{\beta}_1+\hat{\beta}_3)-\hat{\beta}_1=\hat{\beta}_3. \end{aligned} $$

A slope is measured in response units per one unit of \(X\). The intercept is the fitted response at \(X=0\). If zero is outside the observed range or does not make practical sense, the intercept is still an algebraically defined part of the fitted line, but it may not be a meaningful description of an observed case.

Worked Lines in Context

Worked Example: Comparing Two Claim-Handling Groups

A hypothetical insurer models handling hours \(Y\) using claim complexity score \(X\), with \(Z=0\) for standard handling and \(Z=1\) for specialist handling. Its fitted model is \(\widehat{Y}=8+1.5X+3Z+0.5XZ\). Identify both group-specific lines, interpret the interaction coefficient, and calculate the fitted change in hours for a four-point increase in complexity in each group. For a distributional context, suppose errors in the underlying model are independent \(N(0,4)\), so the error variance is 4 hours squared. No interest-rate or mortality assumption applies; neither is used in this regression calculation.

Method. Substitute each group’s indicator value, then collect the constant and \(X\) terms.

For standard handling, set \(Z=0\):

$$ \widehat{Y}=8+1.5X+3(0)+0.5X(0)=8+1.5X. $$

Thus, the standard-handling intercept is 8 hours and its slope is 1.5 hours per complexity point.

For specialist handling, set \(Z=1\):

$$ \widehat{Y}=8+1.5X+3(1)+0.5X(1) =(8+3)+(1.5+0.5)X =11+2X. $$

The specialist-handling intercept is 11 hours and its slope is 2 hours per complexity point. The interaction coefficient, 0.5, is the difference in slopes: \(2-1.5=0.5\) hour per complexity point.

A four-point increase in complexity changes the standard-group fitted response by \(1.5(4)=6\) hours. In the specialist group, the change is \(2(4)=8\) hours. The difference in those changes is \(8-6=2\) hours, which also equals \(0.5(4)=2\) hours. This confirms the slope interpretation. The common mistake is to call 0.5 the specialist group’s slope; the group’s full slope is \(1.5+0.5=2\).

Check. The specialist line has both the intercept increase of 3 and the slope increase of 0.5 specified by the model.

Worked Example: A Negative Interaction Does Not Mean a Negative Group Slope

A hypothetical benefits administrator models monthly processing cost \(Y\), in dollars, from years of account experience \(X\). Let \(Z=0\) identify routine accounts and \(Z=1\) identify complex accounts. The fitted model is \(\widehat{Y}=120-4X+20Z-1.5XZ\). Find the fitted line for each group and state how the group slopes compare. Suppose the model errors are independent \(N(0,100)\), with variance 100 dollars squared. No interest rate or mortality assumption applies.

Method. Apply the binary substitution separately; do not read the interaction term as a complete group slope.

For routine accounts, \(Z=0\), so:

$$ \widehat{Y}=120-4X+20(0)-1.5X(0)=120-4X. $$

The routine-account intercept is 120 dollars and its slope is \(-4\) dollars per year of experience.

For complex accounts, \(Z=1\), so:

$$ \widehat{Y}=120-4X+20(1)-1.5X(1) =(120+20)+(-4-1.5)X =140-5.5X. $$

The complex-account intercept is 140 dollars and its slope is \(-5.5\) dollars per year. The interaction coefficient is \(-1.5\), and the slope difference is \(-5.5-(-4)=-1.5\). Both fitted slopes are negative: the negative interaction makes the complex-account slope 1.5 dollars per year more negative than the routine-account slope. It does not, by itself, imply that the complex-account slope is \(-1.5\).

For a two-year increase in experience, the fitted change is \((-4)(2)=-8\) dollars for routine accounts and \((-5.5)(2)=-11\) dollars for complex accounts. The difference in changes is \(-11-(-8)=-3\) dollars, equal to \((-1.5)(2)=-3\). The common mistake is to subtract magnitudes or report the interaction as the complex-group slope; retaining the signs gives the correct slope difference and group slope.

Check. The complex slope is the routine slope plus the interaction: \(-4+(-1.5)=-5.5\), as in the substituted line.

Worked Example: Tracking Units in a Group-Specific Slope

A hypothetical insurer models annual review cost \(Y\), in thousands of dollars, using portfolio size \(X\), measured in hundreds of policies. Let \(Z=0\) denote a regional portfolio and \(Z=1\) a centralized portfolio. The fitted model is \(\widehat{Y}=6+0.8X-1.2Z+0.3XZ\). Derive both lines, give their intercepts and slopes with units, and compare the fitted changes for a five-unit increase in \(X\), which corresponds to 500 policies. Suppose model errors are independent \(N(0,0.25)\), with variance 0.25 in squared thousands of dollars. No interest-rate or mortality assumption applies.

Method. Substitute the indicator and preserve the stated units of \(X\) and \(Y\).

For regional portfolios, \(Z=0\):

$$ \widehat{Y}=6+0.8X-1.2(0)+0.3X(0)=6+0.8X. $$

The regional intercept is 6 thousand dollars, and its slope is 0.8 thousand dollars per 100 policies.

For centralized portfolios, \(Z=1\):

$$ \widehat{Y}=6+0.8X-1.2(1)+0.3X(1) =(6-1.2)+(0.8+0.3)X =4.8+1.1X. $$

The centralized intercept is 4.8 thousand dollars, and its slope is 1.1 thousand dollars per 100 policies. The slope difference is \(1.1-0.8=0.3\) thousand dollars per 100 policies, matching the interaction coefficient.

For an increase of five units of \(X\), the regional fitted change is \(0.8(5)=4.0\) thousand dollars, or $4,000. The centralized change is \(1.1(5)=5.5\) thousand dollars, or $5,500. The difference is \(5.5-4.0=1.5\) thousand dollars, also \(0.3(5)=1.5\) thousand dollars. The common mistake is to read 0.3 as dollars per policy or to forget that \(X\) is counted in hundreds. The model’s coefficients use the specified measurement units.

Check. Multiplying the slope difference, 0.3 thousand dollars per 100 policies, by five units gives 1.5 thousand dollars for 500 additional policies.

Changing the Group Coding

The formulas depend on which group is coded zero. If the indicator is recoded so that the other group becomes the reference, the coefficient values generally change, but the fitted line for each actual group does not. For example, replacing \(Z\) by \(W=1-Z\) swaps which group’s intercept and slope appear directly as the coefficients on the constant and \(X\). It does not change the underlying fitted relationships.

This is why a coefficient such as \(\hat{\beta}_1\) should not be described as “the slope” without naming the reference group. Under the coding in this tutorial, \(\hat{\beta}_1\) is the slope for \(Z=0\), and \(\hat{\beta}_1+\hat{\beta}_3\) is the slope for \(Z=1\). Likewise, \(\hat{\beta}_2\) is the difference in intercepts at \(X=0\), not an intercept for the \(Z=1\) group by itself.

Common Interpretation Traps

  • Using the interaction coefficient as the full slope. The \(Z=1\) slope is \(\hat{\beta}_1+\hat{\beta}_3\); \(\hat{\beta}_3\) is the change from the \(Z=0\) slope.
  • Adding the interaction coefficient to the intercept. The \(Z=1\) intercept is \(\hat{\beta}_0+\hat{\beta}_2\). The term \(\hat{\beta}_3XZ\) is zero at \(X=0\), so it does not contribute to the intercept.
  • Ignoring signs. If \(\hat{\beta}_1=-4\) and \(\hat{\beta}_3=-1.5\), then the second group’s slope is \(-5.5\), not \(-2.5\) or \(-1.5\).
  • Ignoring units or group coding. A slope’s units depend on how \(X\) and \(Y\) are measured, while the reference group depends on which category is coded \(Z=0\).
  • Overinterpreting the intercept. The group-specific intercept is the fitted response at \(X=0\). If the data cover only positive values far from zero, that intercept may be an extrapolation.
Key takeaway: Substitute \(Z=0\) and \(Z=1\) into the entire fitted equation. The reference group’s line is \(\hat{\beta}_0+\hat{\beta}_1X\); the other group’s line is \((\hat{\beta}_0+\hat{\beta}_2)+(\hat{\beta}_1+\hat{\beta}_3)X\). This makes the group-specific intercepts, slopes, and their differences explicit.

Check Your Understanding

For each problem, derive or interpret the group-specific lines using the stated coding.

  1. A hypothetical model for monthly support cost is \(\widehat{Y}=30+2X-5Z+0.4XZ\), where \(X\) is the number of service requests and \(Z=1\) denotes priority accounts. Give both fitted lines and the difference in slopes. (Answer: \(Z=0:\ 30+2X\); \(Z=1:\ 25+2.4X\); slope difference \(0.4\) cost units per request.)
  2. A fitted model is \(\widehat{Y}=50-3X+8Z+2XZ\), with \(Z=0\) for one region and \(Z=1\) for another. What is the second region’s slope, and what is the predicted fitted change over a three-unit increase in \(X\) for each region? (Answer: second-region slope \(-1\); fitted changes are \(-9\) and \(-3\), respectively.)
  3. For a hypothetical model \(\widehat{Y}=7+0.6X-2Z-0.9XZ\), identify both intercepts and slopes. Is the \(Z=1\) slope negative? (Answer: \(Z=0\) intercept 7 and slope 0.6; \(Z=1\) intercept 5 and slope \(-0.3\); yes.)
  4. A model uses \(\hat{\beta}_0=18\), \(\hat{\beta}_1=1.1\), \(\hat{\beta}_2=4\), and \(\hat{\beta}_3=-0.25\), with \(Z=1\) for the second group. Find each group’s line and the second-minus-first slope difference. (Answer: first group \(18+1.1X\); second group \(22+0.85X\); slope difference \(-0.25\) response units per \(X\)-unit.)
  5. A fitted model has \(\hat{\beta}_0=9\), \(\hat{\beta}_1=-1.2\), \(\hat{\beta}_2=-3\), and \(\hat{\beta}_3=1.7\). State the \(Z=1\) line and explain what the positive interaction indicates about its slope relative to the reference group. (Answer: \(6+0.5X\); its slope is 1.7 response units per \(X\)-unit greater than the reference-group slope, changing from \(-1.2\) to \(0.5\).)
Clinical Biostats