Tutorials › CAS Exam 8 - Advanced Ratemaking › Two-Factor Categorical Interactions

CAS Exam 8 · Predictor Design and Interactions · Tutorial 208 of 989

Two-Factor Categorical Interactions

Build and interpret two-factor categorical interactions by comparing fitted cell means with the no-interaction prediction.

Intermediate 11 min read

What You'll Learn

  • Express two categorical factors and their interaction in a log-link mean model
  • Calculate cell means from a base mean, factor relativities, and interaction multipliers
  • Test whether observed cell means imply a joint effect beyond separate factor effects
  • Compare actual and no-interaction predictions for a portfolio mix
  • Recognize common mistakes in applying interaction relativities

Why Model an Interaction?

Two rating factors may each be associated with a change in expected cost, while their combination has an additional effect. For example, a vehicle characteristic may be associated with different cost changes for different use classes. A model with only separate factor effects assumes that the combined effect follows from those individual effects. An interaction allows the combined cell to depart from that assumption.

For a log-link model, “separate effects” means that the factors combine multiplicatively on the mean scale. It does not mean that their dollar effects add. The interaction is a cell-specific multiplier on the mean predicted from the separate factors.

Definition: A two-factor categorical interaction is an additional model effect that allows the mean for a combination of factor levels to differ from the mean implied by applying the two factors’ separate relativities. Under a log link, the interaction is represented on the mean scale by a multiplicative interaction relativity.

Cell Means and the No-Interaction Prediction

Let factor \(A\) have levels \(0,1,\ldots\), and factor \(B\) have levels \(0,1,\ldots\). Use level \(0\) of each factor as the reference. Let \(\mu_{ab}\) denote the modeled mean for the cell with \(A=a\) and \(B=b\). The mean might be expected loss cost per exposure unit, or another positive quantity appropriate to the response being modeled.

For a two-level illustration, a log-link model with a reference cell and an interaction can be written as

$$ \log(\mu_{ab})=\log(\mu_{00})+\alpha_a+\beta_b+\delta_{ab}. $$

Here \(\alpha_a\) is the main effect for level \(a\) of factor \(A\), \(\beta_b\) is the main effect for level \(b\) of factor \(B\), and \(\delta_{ab}\) is the interaction on the log-mean scale. With reference coding, \(\alpha_0=\beta_0=0\), and the interaction is zero whenever either factor is at its reference level. Exponentiating gives the equivalent multiplicative form:

$$ \mu_{ab}=\mu_{00}\,r_a\,s_b\,\gamma_{ab}, \qquad r_a=e^{\alpha_a},\quad s_b=e^{\beta_b},\quad \gamma_{ab}=e^{\delta_{ab}}. $$

The no-interaction model sets \(\gamma_{ab}=1\) for every cell. Thus its prediction for a non-reference cell is \(\mu_{00}r_as_b\). An interaction relativity above 1 raises that cell’s mean above the no-interaction prediction; one below 1 lowers it. These are model comparisons, not necessarily causal effects.

The GLM framework also requires a response distribution and a suitable variance relationship. The log-link mean formula applies when the modeled mean is positive and the chosen response distribution supports that link. If modeling claim counts with varying exposure, exposure is commonly included as an offset in the linear predictor; it is not itself a categorical interaction. The examples below work with stated cell means or expected cost per exposure unit, so no offset calculation is needed.

A Cross-Product Check for Interaction

For two non-reference levels, the interaction can be recovered directly from the four cell means. Under the multiplicative model,

$$ \gamma_{11} =\frac{\mu_{11}}{\mu_{00}r_1s_1} =\frac{\mu_{11}\mu_{00}}{\mu_{10}\mu_{01}}. $$

The second equality follows because \(\mu_{10}=\mu_{00}r_1\) and \(\mu_{01}=\mu_{00}s_1\). Consequently, the no-interaction prediction is \(\mu_{11}=\mu_{10}\mu_{01}/\mu_{00}\). Comparing \(\mu_{11}\) with this prediction isolates the joint effect, rather than confusing it with either factor’s separate effect.

Worked Example: Finding a Joint Relativity From a Cell Mean

A hypothetical insurer models expected annual cost per policy using two binary factors: vehicle class \(A\) and annual-use band \(B\). The reference cell has mean \(\mu_{00}=\$250\). The separate relativities are \(r_1=1.20\) and \(s_1=1.50\). The fitted mean for cell \(A_1B_1\) is \(\$675\). Calculate the no-interaction prediction and the interaction relativity, then compare the fitted joint mean with both the reference and no-interaction means.

Method. First combine the separate relativities to find the no-interaction prediction:

$$ \mu_{11}^{(\text{no interaction})} =\$250(1.20)(1.50) =\$300(1.50) =\$450. $$

The interaction relativity is the fitted joint mean divided by this prediction:

$$ \gamma_{11}=\frac{\$675}{\$450}=1.50. $$

Thus the joint cell’s fitted mean is 50% above the no-interaction prediction. Relative to the reference mean, its dollar difference is \(\$675-\$250=\$425\); relative to the no-interaction prediction, the difference is \(\$675-\$450=\$225\). These comparisons have different baselines.

Check. Reconstructing the fitted joint mean gives \(\$250(1.20)(1.50)(1.50)=\$675\). The method avoids treating the interaction as a dollar amount or comparing it with the wrong baseline.

Why the Cross-Product Formula Works

The cross-product check removes the separate factor effects algebraically. If there is no interaction, the model gives \(\mu_{10}=\mu_{00}r_1\), \(\mu_{01}=\mu_{00}s_1\), and \(\mu_{11}=\mu_{00}r_1s_1\). Therefore,

$$ \frac{\mu_{11}\mu_{00}}{\mu_{10}\mu_{01}} = \frac{(\mu_{00}r_1s_1)\mu_{00}} {(\mu_{00}r_1)(\mu_{00}s_1)} =1. $$

If the joint cell instead includes an interaction multiplier \(\gamma_{11}\), then \(\mu_{11}=\mu_{00}r_1s_1\gamma_{11}\), so the same ratio simplifies to \(\gamma_{11}\). This is why a ratio of four cell means measures departure from the multiplicative no-interaction pattern. It also shows that “no interaction” is a statement about relative effects on the log-mean scale, not about equal dollar increments.

Worked Example: Checking Cell Means and Portfolio Cost

A hypothetical portfolio has four vehicle-use cells. The modeled expected annual costs per policy are \(\mu_{00}=\$250\), \(\mu_{10}=\$300\), \(\mu_{01}=\$375\), and \(\mu_{11}=\$675\). The corresponding policy counts are 40, 25, 20, and 15. Find the no-interaction prediction for cell \(11\), its interaction relativity, and the portfolio average cost with and without the interaction.

Method. The separate factor relativities are \(r_1=\$300/\$250=1.20\) and \(s_1=\$375/\$250=1.50\). Hence the no-interaction prediction is

$$ \mu_{11}^{(\text{no interaction})} =\$250(1.20)(1.50) =\$450. $$

The interaction relativity is \(\$675/\$450=1.50\). To calculate portfolio average cost, multiply each cell mean by its count and sum. With the fitted interaction, the cell totals are \(40(\$250)=\$10{,}000\), \(25(\$300)=\$7{,}500\), \(20(\$375)=\$7{,}500\), and \(15(\$675)=\$10{,}125\). The total is \(\$10{,}000+\$7{,}500+\$7{,}500+\$10{,}125=\$35{,}125\). There are \(40+25+20+15=100\) policies, so the average is \(\$35{,}125/100=\$351.25\).

Without the interaction, the first three cell totals stay unchanged, and cell \(11\) contributes \(15(\$450)=\$6{,}750\). The no-interaction total is \(\$10{,}000+\$7{,}500+\$7{,}500+\$6{,}750=\$31{,}750\), giving an average of \(\$31{,}750/100=\$317.50\).

Check. The difference between the two portfolio totals is \(\$35{,}125-\$31{,}750=\$3{,}375\), which also equals \(15(\$675-\$450)=15(\$225)=\$3{,}375\). The method avoids applying the interaction to all policies rather than only to the cell it modifies.

More Than Two Levels

A factor with more than two levels can have a distinct interaction relativity for each non-reference level paired with a non-reference level of the other factor. The same calculation applies cell by cell: start with the base mean, apply each factor’s separate relativity, and then apply that cell’s interaction multiplier. Reference cells retain an interaction multiplier of 1 under reference coding.

Worked Example: Interactions Across Several Levels

A hypothetical rating model has three levels of factor \(A\), denoted \(A_0,A_1,A_2\), and two levels of factor \(B\), denoted \(B_0,B_1\). The base mean is \(\mu_{00}=\$500\). The separate relativities are \(r_1=1.10\), \(r_2=0.80\), and \(s_1=1.40\). The fitted interaction relativities are \(\gamma_{11}=1.25\) and \(\gamma_{21}=0.75\). Calculate all six cell means, including the no-interaction comparisons for the two joint cells.

Method. The reference cell is \(\mu_{00}=\$500\). For \(A_1B_0\), the mean is \(\$500(1.10)=\$550\); for \(A_2B_0\), it is \(\$500(0.80)=\$400\). For \(A_0B_1\), it is \(\$500(1.40)=\$700\).

For \(A_1B_1\), the no-interaction prediction is \(\$500(1.10)(1.40)=\$770\). Applying its interaction gives \(\$770(1.25)=\$962.50\). For \(A_2B_1\), the no-interaction prediction is \(\$500(0.80)(1.40)=\$560\). Applying its interaction gives \(\$560(0.75)=\$420\).

The six fitted means are therefore \(\$500,\$550,\$400,\$700,\$962.50,\$420\), in the order \(A_0B_0,A_1B_0,A_2B_0,A_0B_1,A_1B_1,A_2B_1\). As a check, the cross-product ratios are \((\$962.50)(\$500)/[(\$550)(\$700)]=1.25\) and \((\$420)(\$500)/[(\$400)(\$700)]=0.75\). Both recover the stated interaction relativities.

Common mistake avoided. Applying \(A_1\)'s interaction relativity to \(A_2B_1\) would give the wrong cell mean. Each interaction belongs to its specified pair of levels.

Common Mistakes and Practical Interpretation

A fitted interaction should be interpreted against the no-interaction prediction for the same cell. For example, if the interaction multiplier is 1.25 and the no-interaction mean is \(\$600\), the fitted mean is \(\$600(1.25)=\$750\), not \(\$600+\$1.25=\$601.25\). The multiplier represents a proportional change, not a dollar increment.

  • Adding factor relativities. Under the log link, separate relativities multiply on the mean scale. A base mean of \(\$400\) with relativities 1.20 and 1.50 gives \(\$400(1.20)(1.50)=\$720\), not \(\$400(1+0.20+0.50)=\$680\).
  • Confusing interaction with a main effect. The interaction compares a joint cell with the prediction already incorporating both main effects. It is not the joint mean divided by the base mean alone.
  • Ignoring the reference levels. Relativities depend on the chosen reference coding, but the fitted cell means and comparisons of those means do not. State the reference levels before reporting factor relativities.
  • Overlooking portfolio mix. A change in one cell mean affects the portfolio total in proportion to the number or exposure of risks in that cell. The interaction multiplier is not applied to every policy.

Interactions can improve fit when joint groups behave differently from the separate-factor pattern, but they also add parameters. A cell mean based on limited information may be uncertain, so a plausible-looking interaction should not be treated as automatically reliable. Interpretation should distinguish the estimated cell effect from the uncertainty in that estimate.

Key takeaway: Under a log link, calculate the no-interaction cell mean by multiplying the base mean by the separate factor relativities. Divide the fitted joint mean by that prediction to obtain the interaction relativity. A value of 1 means no departure from the multiplicative pattern.

Check Your Understanding

For each problem, calculate on the mean scale and compare with the specified no-interaction pattern.

  1. A model has base mean \(\$320\), separate relativities 1.25 and 1.40, and interaction relativity 1.10 for the joint cell. Find the fitted joint mean. (Answer: \(\$616.00\))
  2. Four fitted means are \(\mu_{00}=\$480\), \(\mu_{10}=\$600\), \(\mu_{01}=\$720\), and \(\mu_{11}=\$990\). Find the no-interaction prediction and interaction relativity. (Answer: no-interaction mean \(\$900\); interaction relativity \(1.10\))
  3. Cell means are \(\mu_{00}=\$200\), \(\mu_{10}=\$260\), \(\mu_{01}=\$300\), and \(\mu_{11}=\$390\). Does the joint cell indicate an interaction? Give the interaction relativity. (Answer: no; interaction relativity \(1.00\))
  4. A portfolio has counts 10, 20, 30, and 40 in cells \(00,10,01,11\), with respective means \(\$100,\$120,\$150,\$225\). The no-interaction prediction for cell \(11\) is \(\$180\). Find the portfolio average with the fitted joint mean and with no interaction. (Answer: fitted-interaction average \(\$169.00\); no-interaction average \(\$151.00\))
  5. The base mean is \(\$600\), the \(A_2\) relativity is 0.90, the \(B_1\) relativity is 1.30, and the fitted \(A_2B_1\) mean is \(\$526.50\). Find the interaction relativity. (Answer: \(0.75\))
Clinical Biostats