Why Allow Different Slopes?
A rating model may show that expected loss changes with a continuous characteristic, such as years of equipment age. But the pattern need not be the same for every category of another rating variable. For example, expected loss might increase more quickly with age for one vehicle class than for another. A categorical-continuous interaction represents this difference in slopes.
The interaction changes the fitted relationship between the continuous predictor and the expected response by category. Consequently, a category comparison is not necessarily one fixed multiplier: the relative difference between categories can depend on the value of the continuous predictor.
Binary Category: Model and Relativities
Let \(G\) be an indicator for a categorical level: \(G=0\) denotes the reference level and \(G=1\) denotes the other level. Let \(x\) be a continuous predictor, possibly centered or scaled. For a positive expected response \(\mu\), a log-linked model with exposure \(e\) as an offset is
Here \(\mu\) is the modeled expected total response at exposure \(e\). If the response is an expected loss cost per exposure unit, the offset makes the total expected response proportional to exposure. The model assumes a log link and a linear predictor containing the stated terms; any probability model used to estimate it must also be appropriate for the response and its variance. The mean formulas below describe the fitted conditional mean. They do not, by themselves, establish that the model fits well.
For the reference level, setting \(G=0\) removes both terms involving \(G\). For the other level, setting \(G=1\) adds \(\beta_1+\beta_3x\). Thus the category comparison at a fixed \(x\) and the continuous-predictor slope within a category follow directly from the model.
The first expression is the relativity of level 1 to level 0 at predictor value \(x\); it is not generally a constant. The second expression is the slope on the log-mean scale. For a one-unit increase in \(x\), the mean is multiplied by \(\exp(\beta_2)\) at \(G=0\), and by \(\exp(\beta_2+\beta_3)\) at \(G=1\). If \(x\) has been scaled in ten-year units, for example, a one-unit increase means ten years.
Why the Comparison Depends on \(x\)
The relativity formula can be justified by exponentiating the fitted log means for each level and taking their ratio. Holding exposure and \(x\) fixed, the common terms cancel:
This also shows why \(\beta_3\) matters to the comparison: it remains in the ratio as \(\beta_3x\). Equivalently, for a change from \(x\) to \(x+\Delta\), the level-1-to-level-0 relativity is multiplied by \(\exp(\beta_3\Delta)\). If \(\beta_3=0\), the ratio is constant in \(x\), and the interaction makes no change to the fitted category comparison.
A category's mean at any value can also be compared with its own mean at a reference value \(x_0\). The exposure-adjusted within-category multiplier is
provided the comparison holds exposure fixed. This is useful for describing the fitted curve within a level. It is distinct from comparing two category levels at the same \(x\).
Worked Example: A Category Relativity That Changes With Age
A hypothetical insurer models expected annual loss cost per exposure unit using \(x\), the number of ten-year increments above age 30, and \(G\), an indicator for a telematics program. Suppose the fitted model is
Find the fitted cost per exposure unit for each category at ages 30, 40, and 50, and the program-to-no-program relativity at each age. Use \(e=1\) for the requested per-unit costs.
Method and setup. The reference category is \(G=0\), and \(x=0,1,2\) at ages 30, 40, and 50. The base expected cost at \(x=0,G=0\) is \(500\). The reference category's per-increment multiplier is \(1.10\). For \(G=1\), the per-increment multiplier is \(1.10\times1.10=1.21\), and the category ratio at \(x\) is \(1.20\times1.10^x\).
Age 30 (\(x=0\)). The reference cost is \(500.00\times1.10^0=\$500.00\). The program cost is \(500.00\times1.20=\$600.00\). The ratio is \(600.00/500.00=1.2000\).
Age 40 (\(x=1\)). The reference cost is \(500.00\times1.10=\$550.00\). The program cost is \(600.00\times1.21=\$726.00\). The ratio is \(726.00/550.00=1.3200\), also \(1.20\times1.10=1.3200\).
Age 50 (\(x=2\)). The reference cost is \(500.00\times1.10^2=\$605.00\). The program cost is \(600.00\times1.21^2=600.00\times1.4641=\$878.46\). The ratio is \(878.46/605.00=1.4520\), also \(1.20\times1.10^2=1.4520\).
Check and mistake avoided. Each ratio agrees with the direct category comparison formula. Using \(1.20\) at all ages would incorrectly omit the interaction: it is the category relativity at the centered value \(x=0\), not a universal program factor.
More Than Two Categorical Levels
For a factor with several levels, use indicator variables for the nonreference levels. If level \(j\) has indicator \(G_j\), the log mean can include a main effect \(\alpha_jG_j\) and an interaction \(\gamma_jG_jx\). With level 0 as the reference, the model is
For the reference level, the log-mean slope is \(\beta_x\). For level \(j\), it is \(\beta_x+\gamma_j\), and that level's relativity to the reference at \(x\) is \(\exp(\alpha_j+\gamma_jx)\). These expressions require the stated reference-indicator coding. A different coding changes the individual coefficient meanings, although fitted comparisons at specified predictor values can still be calculated from the fitted model.
Worked Example: Comparing Three Equipment Classes
A hypothetical insurer models expected annual loss cost per exposure unit for three equipment classes. Let \(x\) be age in five-year increments from a reference age, so \(x=0\) is the reference age and \(x=2\) is ten years older. Class A is the reference. The fitted cost at \(x=0\) is \(\$300.00\). Its cost multiplier per increment is \(1.05\). Class B has a base relativity of \(1.25\) and multiplier \(1.08\) per increment; Class C has a base relativity of \(0.90\) and multiplier \(0.98\) per increment. Find the fitted costs at \(x=2\), and B's relativity to A there.
Method. Calculate each class's base cost, then apply its own per-increment multiplier twice. The implied B-to-A ratio is its base relativity multiplied by the ratio of the classes' per-increment multipliers, raised to the two increments.
Class A. At \(x=2\), the cost is \(300.00\times1.05^2=300.00\times1.1025=\$330.75\).
Class B. Its base cost is \(300.00\times1.25=\$375.00\). At \(x=2\), its cost is \(375.00\times1.08^2=375.00\times1.1664=\$437.40\).
Class C. Its base cost is \(300.00\times0.90=\$270.00\). At \(x=2\), its cost is \(270.00\times0.98^2=270.00\times0.9604=\$259.31\), rounded to the nearest cent.
B relative to A. The ratio is \(437.40/330.75=1.3224\), rounded to four decimal places. From the model factors, it is also \(1.25(1.08/1.05)^2=1.3224\). The agreement checks the calculation.
Mistake avoided. Applying Class B's \(1.08\) multiplier to Class A, or applying Class A's \(1.05\) multiplier to Class B, would discard the class-specific slope. The \(1.25\) base relativity alone is valid only at \(x=0\).
Interpretation, Centering, and Practical Checks
Centering \(x\) at a meaningful value makes the main category comparison easier to interpret. If \(x=x_{\text{raw}}-c\), then \(x=0\) represents raw predictor value \(c\), and \(\exp(\beta_1)\) is the category relativity at that value. Centering does not remove the interaction or change the fitted means when the model is expressed consistently; it changes which predictor value corresponds to the category main effect.
The sign of the interaction coefficient describes how the category relativity changes with \(x\) under this coding. If \(\beta_3>0\), \(\exp(\beta_1+\beta_3x)\) increases as \(x\) increases. If \(\beta_3<0\), it decreases. This statement concerns the ratio between category means; it does not imply that either category's own mean must increase or decrease. Each category's slope depends on both \(\beta_2\) and \(\beta_3\).
The fitted model should be used only over predictor ranges where its specification is defensible. A linear effect on the log-mean scale implies an exponential mean curve, which may be unsuitable for extrapolation far beyond the observed range. An interaction also uses additional information to estimate different slopes; sparse observations in a category or limited overlap in predictor values can make its estimates unstable.
Common Exam Traps
- Dropping the interaction when comparing categories. The ratio is \(\exp(\beta_1+\beta_3x)\), not always \(\exp(\beta_1)\).
- Confusing a log-scale slope with a multiplicative change. The slope is \(\beta_2+\beta_3G\); the one-unit mean multiplier is its exponential.
- Forgetting the predictor's units or centering point. A one-unit change could mean one year, five years, or another defined increment. The main effect compares levels where \(x=0\), which may not be the raw predictor's zero.
- Using a ratio to infer a trend within a category. A between-category ratio and a within-category change answer different questions and use different formulas.
Check Your Understanding
For each problem, identify the required comparison before calculating.
- A binary-factor model has category ratio \(\exp(\beta_1+\beta_3x)=1.10(1.04)^x\), where \(x\) is measured in five-year increments from the reference point. Find the nonreference-to-reference ratio at \(x=3\). (Answer: \(1.2374\), to four decimal places.)
- At \(x=0\), category B has relativity \(0.85\) to category A. Their per-unit \(x\) multipliers are \(1.07\) and \(1.03\), respectively. Find B's relativity to A at \(x=4\). (Answer: \(0.85(1.07/1.03)^4=0.9899\), approximately.)
- A model gives the category ratio as \(\exp(-0.10+0.05x)\). At what \(x\) is the ratio exactly 1? (Answer: \(x=2\), since \(-0.10+0.05(2)=0\).)
- The reference category has fitted cost \(\$240.00\) at \(x=0\) and multiplier \(1.02\) per unit. A second category has base relativity \(1.30\) and multiplier \(1.06\) per unit. Find its fitted cost at \(x=3\). (Answer: \(240.00(1.30)(1.06)^3=\$371.60\), to the nearest cent.)
- A category ratio to the reference is \(0.90(1.12)^x\), with \(x\) in ten-year increments. Find the value of \(x\) where the two fitted means are equal. (Answer: \(x=-\ln(0.90)/\ln(1.12)\approx0.9297\), or approximately 9.297 years above the reference value.)