Tutorials › Exam PA - Predictive Analytics › Encode Interactions for Renewal Risk

Exam PA · End-to-End Case Analysis · Tutorial 879 of 966

Encode Interactions for Renewal Risk

Build a renewal-risk GLM interaction, interpret its effect on claim rates, and check whether the data and prediction task justify including it.

Advanced 11 min read

What You'll Learn

  • Encode a two-factor interaction in a log-link claim-count GLM with an exposure offset
  • Interpret main effects relative to reference categories
  • Calculate an interaction as a ratio of rate ratios
  • Distinguish a sparse interaction cell from a cell with no observations
  • Check whether the observed data can estimate the interaction
  • Decide whether an interaction is relevant to the stated prediction task

Why Interactions Matter in Renewal Risk

A renewal-risk model may use characteristics such as driver experience and territory to predict claim counts. A model with only separate effects for each characteristic assumes that the effect of experience is the same in every territory. That may be a poor representation: the difference in claim rates between novice and experienced drivers could be larger in urban areas than in rural areas.

An interaction allows the effect of one predictor to depend on the value of another. It can improve a prediction when that dependence is supported by the data and is relevant to the intended use. It is not automatically justified merely because the model can include an extra term.

Definition: In a generalized linear model, an interaction between two predictors is a model term that allows the effect of one predictor on the linear predictor to vary with the other predictor. For two binary indicators, the interaction is their product. With a log link, its coefficient describes a multiplicative change in a rate ratio.

Set Up the Claim-Count Model

Suppose each row represents a policy-year, \(N\) is its claim count, and \(e\) is its exposure measured in policy-years. Let \(U=1\) indicate a novice driver and \(U=0\) an experienced driver. Let \(C=1\) indicate an urban territory and \(C=0\) a rural territory. A Poisson GLM with a log link and exposure offset is

$$ N \mid U,C,e \sim \operatorname{Poisson}(\mu), \qquad \log(\mu)=\log(e)+\beta_0+\beta_U U+\beta_C C+\beta_{UC}UC. $$

The offset \(\log(e)\) has a coefficient fixed at 1. Dividing the expected count by exposure gives the predicted claim rate per policy-year:

$$ \log\left(\frac{\mu}{e}\right) =\beta_0+\beta_U U+\beta_C C+\beta_{UC}UC. $$

This specification assumes that the conditional claim count follows a Poisson distribution, that the log of the rate is represented by the stated linear predictor, and that expected count is proportional to exposure. It also requires positive exposure to calculate the offset. The usual Poisson model assumes conditional independence of the counts and equality of conditional mean and variance. If claim counts are more variable than that assumption allows, standard errors and model fit assessments may be unreliable; the mean-model interaction still needs to be considered on its own merits.

With the chosen coding, the rural, experienced-driver group is the reference group. Its rate is \(\exp(\beta_0)\). The main effect \(\beta_U\) compares novice with experienced drivers in rural territory, while \(\beta_C\) compares urban with rural territory for experienced drivers. The interaction coefficient is needed to describe the additional change when both indicators equal 1.

Derive the Interaction Interpretation

The model’s four group-specific rates make the coefficient interpretation precise. Set \(r_{UC}=\mu/e\), the predicted rate for a group with indicators \(U,C\). Substitution gives:

$$ r_{00}=\exp(\beta_0), \quad r_{10}=\exp(\beta_0+\beta_U), \quad r_{01}=\exp(\beta_0+\beta_C), \quad r_{11}=\exp(\beta_0+\beta_U+\beta_C+\beta_{UC}). $$

The novice-to-experienced rate ratio in rural territory is \(r_{10}/r_{00}=\exp(\beta_U)\). In urban territory it is \(r_{11}/r_{01}=\exp(\beta_U+\beta_{UC})\). Dividing the second ratio by the first cancels the shared novice effect and leaves the interaction:

$$ \frac{r_{11}/r_{01}}{r_{10}/r_{00}} =\exp(\beta_{UC}). $$

Thus, \(\exp(\beta_{UC})\) is a ratio of rate ratios. A value of 1 means the novice-to-experienced rate ratio is the same in both territories, so this model’s interaction makes no adjustment to the combined group beyond the two main effects. A value above 1 means the novice effect is larger in urban territory on the multiplicative rate scale; a value below 1 means it is smaller.

Worked Example: Estimate and Interpret a Two-Factor Interaction

A hypothetical insurer summarizes claim experience by driver experience and territory. The table gives claim counts and total policy-year exposure. Treat each cell’s claim count as Poisson with mean equal to exposure times a group-specific rate. Calculate the four rates, the interaction coefficient in the saturated two-factor model, and its interpretation.

Driver groupTerritoryClaimsExposure
ExperiencedRural201,000
ExperiencedUrban301,000
NoviceRural401,000
NoviceUrban1201,000

Method. Estimate each cell rate as claims divided by exposure. With all four cells observed, the model containing the intercept, both main effects, and their interaction can represent these four group rates.

Step 1: Calculate the rates. The experienced-rural rate is \(20/1{,}000=0.020\). The experienced-urban rate is \(30/1{,}000=0.030\). The novice-rural rate is \(40/1{,}000=0.040\). The novice-urban rate is \(120/1{,}000=0.120\) claims per policy-year.

Step 2: Calculate the two novice rate ratios. In rural territory, the ratio is \(0.040/0.020=2\). In urban territory, it is \(0.120/0.030=4\).

Step 3: Calculate the ratio of rate ratios. The interaction multiplier is \(4/2=2\), so \(\exp(\beta_{UC})=2\) and \(\beta_{UC}=\log(2)\approx0.6931\). The main effects are \(\beta_U=\log(2)\approx0.6931\) and \(\beta_C=\log(1.5)\approx0.4055\), while \(\beta_0=\log(0.020)\approx-3.9120\).

Check. The model predicts the novice-urban rate as \(0.020\times2\times1.5\times2=0.120\), matching \(120/1{,}000\). Rounded to four decimal places, the interaction coefficient is 0.6931. Here the novice-to-experienced rate ratio is twice as large in urban territory as it is in rural territory. This describes the fitted rates; by itself, it does not establish why the difference occurs.

Common mistake avoided: Reporting \(\exp(\beta_{UC})=2\) as the novice-urban rate, or as the novice effect in urban territory, is incorrect. It is the multiplicative adjustment to the novice rate ratio when moving from rural to urban territory.

Encode and Predict With the Interaction

For binary indicators, the product \(UC\) is 1 only for novice drivers in urban territory. In R, with the reference levels set to experienced and rural, the model can be specified as follows:

$$ \texttt{claim\_count \textasciitilde\ novice * territory + offset(log(exposure))} $$

In R formula notation, `novice * territory` expands to both main effects and their interaction. The data should contain one row per modeled observation, a count response, and a positive exposure variable. Factor reference levels should be checked explicitly because changing them changes the meaning of the individual coefficients, even though it does not change the fitted values of a model with the same terms.

Worked Example: Predict a Novice Urban Policy-Year

Use the fitted coefficients from the previous example to predict the expected claim count for a novice driver in an urban territory with 0.5 policy-years of exposure. Also calculate the prediction from a model that omits the interaction, keeping the same estimated main effects.

Method. Use the log-link model to calculate the rate first, then multiply by exposure to obtain the expected count. The interaction-free calculation sets \(\beta_{UC}=0\).

With the interaction. The novice-urban rate is \(0.020\times2\times1.5\times2=0.120\). For exposure \(e=0.5\), the expected count is \(0.5\times0.120=0.060\) claims.

Without the interaction. The rate would be \(0.020\times2\times1.5=0.060\). The corresponding expected count is \(0.5\times0.060=0.030\) claims.

Check. The interaction doubles the predicted rate and expected count for this combined group relative to the main-effects-only prediction: \(0.060/0.030=2\). The expected count is not a claim probability; a Poisson count may exceed 1. Rounded to three decimal places, the two expected counts are 0.060 and 0.030. The calculation assumes the fitted rate applies to the stated exposure.

Common mistake avoided: Applying the interaction multiplier to every novice policy would be wrong. In this coding, the product \(UC\) equals 1 only for novice drivers in urban territory.

Check Plausibility, Estimability, and Usefulness

These are separate questions. Plausibility asks whether the interaction is defensible for the modeled risk and whether it makes sense on the chosen scale. Estimability asks whether the data contain enough information to determine its coefficient. Usefulness asks whether including it improves the predictions needed for the stated task enough to justify added complexity.

1
State the hypothesis.
Explain why the relationship between one characteristic and claim rate might differ across levels of the other. The interaction should represent a meaningful risk pattern, not just an unexamined search through combinations.
2
Check the observed combinations.
Inspect exposure and claim counts for every combination. A category combination with no observations cannot inform its own fitted rate; a very small cell may produce an unstable estimate.
3
Interpret the fitted effect.
Translate the coefficient into a rate ratio or ratio of rate ratios. Check whether the direction and magnitude are credible for the prediction context, and whether the estimate is too uncertain to rely on.
4
Assess task-specific value.
Ask whether the interaction improves predictions for the intended renewal decision or population. An in-sample difference alone is not sufficient evidence that the added term will help future predictions.

A key distinction is between a cell with no exposure and a cell with positive exposure but zero claims. With no observations in a combination, the data provide no direct information about that combination’s fitted mean. With positive exposure and zero claims, the cell is observed, but its estimated rate may be at the boundary of zero in a saturated Poisson model; this can prevent finite estimates for some log-scale coefficients. Low, nonzero counts can also yield highly uncertain interaction estimates.

Worked Example: Identify an Interaction That Cannot Be Estimated

A hypothetical renewal dataset contains the following three groups: experienced-rural has 8 claims in 400 policy-years; experienced-urban has 9 claims in 300 policy-years; novice-rural has 8 claims in 200 policy-years. There are no novice-urban policy-years in the modeling data. Determine whether the four-parameter interaction model can estimate \(\beta_{UC}\).

Method. Check whether the observed predictor combinations provide independent information about all four model coefficients: intercept, novice main effect, urban main effect, and interaction.

Step 1: Calculate the observed rates. Experienced-rural is \(8/400=0.020\); experienced-urban is \(9/300=0.030\); novice-rural is \(8/200=0.040\) claims per policy-year. There is no observed novice-urban rate because its exposure is zero.

Step 2: Check the interaction column. For the three observed groups, the rows \((1,U,C,UC)\) are \((1,0,0,0)\), \((1,0,1,0)\), and \((1,1,0,0)\). The interaction column is zero for every observation. Therefore, changing \(\beta_{UC}\) leaves every observed fitted mean unchanged.

Conclusion and check. The interaction coefficient is not estimable from these data: the observed design contains no information about it. Any novice-urban prediction that uses this coefficient would depend on an imposed assumption, not on an estimated interaction supported by this dataset. The three observed rates can be fit by the intercept and main effects, but they do not determine the missing fourth cell. Rounded to three decimal places, the observed rates are 0.020, 0.030, and 0.040.

Common mistake avoided: Treating the missing novice-urban cell as if it had a zero claim count is incorrect. Zero exposure means no policy-years were observed; it does not mean the observed claim count was zero.

Decide Whether the Term Helps the Prediction Task

A plausible, estimable interaction may still be unnecessary. Begin with the purpose of the prediction. If the task is to estimate rates for each territory-experience combination, an interaction can matter directly when it changes those group predictions. If the model is intended to support a broader renewal decision, the relevant question is whether the interaction produces a useful change in predictions for the renewal population and decision, rather than merely whether its coefficient is nonzero in the fitted sample.

Consider also the costs of added complexity. An interaction uses information from combinations of categories, so it can be sensitive to small or imbalanced cells. A large estimated effect based on very limited exposure may be unstable. Conversely, omitting a well-supported interaction can systematically underpredict one combination and overpredict another. A defensible choice therefore considers the substantive rationale, the cell-level data, uncertainty, and prediction performance appropriate to the stated task.

Key takeaway: In a log-link model, an interaction coefficient is interpreted through a ratio of rate ratios. Include an interaction only when its meaning is clear, the observed data can estimate it, and it is useful for the prediction task at hand.

Check Your Understanding

For each problem, calculate or identify what the interaction model supports. Rates are per policy-year unless stated otherwise.

  1. A hypothetical model has experienced-rural rate 0.015, experienced-urban rate 0.030, novice-rural rate 0.045, and novice-urban rate 0.135. Calculate the ratio of rate ratios and the interaction coefficient. (Answer: ratio of rate ratios \(=(0.135/0.030)/(0.045/0.015)=3/2=1.5\); \(\beta_{UC}=\log(1.5)\approx0.4055\).)
  2. A fitted model has baseline rate 0.040, a novice multiplier of 1.25, an urban multiplier of 2, and an interaction multiplier of 1.6. Calculate the novice-urban rate and expected count for 0.25 policy-years. (Answer: rate \(=0.040(1.25)(2)(1.6)=0.160\); expected count \(=0.25(0.160)=0.040\).)
  3. A main-effects-only model has experienced-rural rate 0.010, novice multiplier 3, and urban multiplier 2. What novice-urban rate does it predict, and what expected count follows for 0.4 policy-years? (Answer: rate \(=0.010(3)(2)=0.060\); expected count \(=0.4(0.060)=0.024\).)
  4. A policy portfolio has positive exposure in all four experience-territory combinations, but only 2 claims in one combination. Is the interaction necessarily non-estimable, and what concern remains? (Answer: It is not necessarily non-estimable because the combination is observed, but the low count may make the interaction estimate unstable and uncertain.)
  5. A dataset includes 500 novice-rural policy-years and no novice-urban policy-years. Which interaction coefficient is unsupported by the observed combinations, and why? (Answer: The novice-by-urban interaction is unsupported; its product indicator is zero for every observation, so changing its coefficient does not change any fitted mean.)
Clinical Biostats