Tutorials › CAS Exam 8 - Advanced Ratemaking › Transformations for Skewed Rating Predictors

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

Transformations for Skewed Rating Predictors

Learn to choose and interpret transformed predictors, calculate fitted-mean relativities, and check that the transformation has a defensible rating meaning.

Intermediate 10 min read

What You'll Learn

  • Distinguish transforming a predictor from changing the GLM link function.
  • Interpret mean ratios for transformed predictors while holding other model terms fixed.
  • Calculate effects under logarithmic, square-root, and shifted-log transformations.
  • Check transformation domains, units, and the practical meaning of a rating change.
  • Recognize common coefficient-interpretation errors and limits on extrapolation.

Why Transform a Rating Predictor?

A continuous rating variable need not have a straight-line effect on the model’s linear predictor when entered in its original units. For example, an increase in annual mileage from 1,000 to 2,000 may have a different modeled effect from an increase from 20,000 to 21,000. A transformation can represent such changing increments with one coefficient, while retaining a single continuous predictor.

A transformation is a choice about the predictor’s shape in the model. It is not the same as changing the GLM link, and it does not by itself assert that the predictor follows a particular probability distribution. A skewed predictor may be transformed to express a plausible relationship or to make increments more useful; skewness alone does not prove that a transformation is appropriate.

Definition: Let \(X\) be a continuous rating predictor and let \(g\) be a specified function. A transformed-predictor GLM uses \(g(X)\), rather than \(X\) itself, as a model term. With a log link, the conditional mean can be written $$ \log \mu_i = \log e_i + \beta_0 + \beta_1 g(x_i) + \boldsymbol{\gamma}^{\mathsf T}\mathbf z_i, $$ where \(\mu_i\) is the expected response for observation \(i\), \(e_i\) is an exposure offset when applicable, and \(\mathbf z_i\) denotes other predictors. The transformation’s domain and units must be specified.

For an increasing transformation, a larger original predictor gives a larger transformed value; for a decreasing transformation, the transformed order is reversed. Either way, the coefficient applies to a one-unit change in \(g(X)\), not generally to a one-unit change in \(X\). Its rating meaning is best described by comparing fitted means at two meaningful values of the original predictor.

Mean Ratios and the Shape of the Effect

Suppose two otherwise identical risks have predictor values \(x_1\) and \(x_2\), and their exposures are equal. Subtracting their log-mean equations eliminates the intercept, offset, and all shared terms. Exponentiating the result gives the fitted-mean ratio:

$$ \frac{\mu(x_2)}{\mu(x_1)} = \exp\!\left(\beta_1\left[g(x_2)-g(x_1)\right]\right). $$

If exposures differ, the ratio of expected totals also includes the exposure ratio \(e_2/e_1\). It is therefore important to distinguish a rate comparison from a comparison of expected counts over different exposure amounts.

The formula also shows why the transformed effect is not usually a constant percentage change per raw unit. When \(g\) is differentiable, the local rate of change in log mean is \(\beta_1 g'(x)\). Thus, the effect of a small increase in \(x\) depends on the current value of \(x\), unless \(g'(x)\) is constant.

Derivation: With other terms and exposure held fixed, write \(\log\mu(x)=C+\beta_1g(x)\), where \(C\) is common to both risks. Then \(\log\mu(x_2)-\log\mu(x_1)=\beta_1[g(x_2)-g(x_1)]\). Since the left side is \(\log[\mu(x_2)/\mu(x_1)]\), exponentiating both sides yields the mean-ratio formula. Differentiating \(\log\mu(x)=C+\beta_1g(x)\) with respect to \(x\) gives \(d\log\mu(x)/dx=\beta_1g'(x)\).

Common Transformations and Their Interpretations

Transformation \(g(x)\)Typical domainInterpretive feature
\(\log x\)\(x>0\)A multiplicative change in \(x\) produces a fixed change in \(\log x\).
\(\sqrt{x}\)\(x\geq 0\)Equal increments in the transformed scale correspond to larger raw-scale increments at larger \(x\).
\(\log(1+x/c)\)\(x\geq 0,\ c>0\)The constant \(c\) sets the scale; the transformation accommodates zero and has diminishing increments.
\(1/x\)\(x>0\)This transformation is decreasing, so a positive coefficient implies a decreasing fitted mean as \(x\) increases.

The natural logarithm is assumed in these examples. If \(g(x)=\log x\), then the mean ratio is \((x_2/x_1)^{\beta_1}\). A doubling of \(x\) therefore has ratio \(2^{\beta_1}\), regardless of the starting value, under this model. For a square-root transformation, by contrast, the ratio depends on \(\sqrt{x_2}-\sqrt{x_1}\). The values of \(x\) being compared must be stated.

A shifted logarithm such as \(\log(1+x/c)\) is sometimes useful when zero is a legitimate predictor value. The shift and scale are part of the model specification, not an automatic technical fix. Changing them changes the spacing between transformed values and can change fitted effects. In particular, a value of \(c\) should be chosen and documented for a practical reason, rather than selected only to make a formula convenient.

Worked Example: A Square-Root Effect on Claim Frequency

Method. Compare fitted conditional means using the transformed-predictor mean-ratio formula. Consider a hypothetical rating model for claim counts per one unit of exposure. Assume independent observations with \(Y_i\mid x_i\sim\operatorname{Poisson}(\mu_i)\), a log link, equal exposure, and all other rating terms held fixed. There is no interest or mortality assumption in this frequency-model comparison. The square-root term has coefficient \(\beta_1=0.12\). At \(x=4\), the fitted mean is \(0.0800\) claims per exposure unit. Compare \(x=4\) with \(x=25\).

Step 1: Transform the two predictor values. The square roots are \(\sqrt{4}=2\) and \(\sqrt{25}=5\), so the transformed difference is \(5-2=3\).

Step 2: Calculate the fitted-mean ratio. $$ \exp\!\left[0.12(5-2)\right]=\exp(0.36)=1.4333. $$

Step 3: Calculate the second fitted mean. Multiplying the reference mean by the ratio gives \(0.0800(1.4333)=0.114664\), or \(0.1147\) claims per exposure unit to four decimal places.

Check and mistake avoided. The higher predictor value has a higher fitted mean because the transformation is increasing and the coefficient is positive. The calculation uses a transformed difference of 3, not the raw difference \(25-4=21\). Applying the coefficient to 21 would incorrectly produce a ratio of \(\exp(2.52)\), about 12.43, rather than 1.4333.

Worked Example: A Log-Mileage Effect

Method. Use the ratio of mileage values to interpret a log-transformed predictor. Consider a hypothetical claim-frequency model with \(Y_i\mid x_i\sim\operatorname{Poisson}(\mu_i)\), a log link, equal exposure, and other terms fixed. The predictor is annual mileage \(x\), measured in thousands of miles, and the model term is \(\log x\). The coefficient is \(\beta_1=0.18\); at 5 thousand miles the fitted mean is \(0.0625\). Interest and mortality are not relevant to this frequency comparison. Find the mean at 20 thousand miles and the effect of doubling mileage.

Step 1: Compare 5 and 20 thousand miles. The transformed difference is \(\log(20)-\log(5)=\log(4)=1.386294\).

Step 2: Calculate the ratio. $$ \exp\!\left[0.18\log(4)\right] = \exp(0.249533) = 1.2834. $$

Step 3: Calculate the fitted mean. The mean at 20 thousand miles is \(0.0625(1.2834)=0.0802125\), or \(0.0802\) to four decimal places.

Step 4: Interpret a doubling. A doubling has ratio \(\exp[0.18\log(2)]=2^{0.18}=1.1329\). Thus, within this model, each doubling multiplies the conditional mean by about 1.1329, with other terms and exposure unchanged.

Check and mistake avoided. The 20-thousand-mile mean exceeds the 5-thousand-mile mean, as the positive coefficient and increasing log transformation imply. A common error is to treat \(0.18\) as a coefficient per thousand miles and calculate \(\exp[0.18(20-5)]=\exp(2.7)\), about 14.88. That is wrong because the model term is \(\log x\), not \(x\).

Worked Example: Including Zero With a Shifted Logarithm

Method. Compare transformed values directly, including the specified shift. Suppose a hypothetical model predicts claim counts per unit exposure, with \(Y_i\mid x_i\sim\operatorname{Poisson}(\mu_i)\), a log link, equal exposure, and all other terms fixed. The predictor is years with no reported claim, \(x\), and the model term is \(\log(1+x)\), with \(x\) measured in years. The coefficient is \(-0.10\), and the fitted mean at \(x=0\) is \(0.2000\). Interest and mortality are not applicable. Find the fitted mean at three years.

Step 1: Calculate the transformed difference. At zero, the transformed value is \(\log(1+0)=0\). At three, it is \(\log(1+3)=\log(4)=1.386294\).

Step 2: Calculate the mean ratio. $$ \exp\!\left[-0.10\log(4)\right] = \exp(-0.138629) = 0.8706. $$

Step 3: Calculate the fitted mean. The fitted mean is \(0.2000(0.8706)=0.17412\), or \(0.1741\) to four decimal places.

Check and mistake avoided. The mean falls as years without a claim increase, consistent with the negative coefficient and the increasing transformation. The exact ratio is \(4^{-0.10}\); it is not \(\exp[-0.10(3-0)]\), because the predictor difference in the linear predictor is \(\log(4)-\log(1)\), not three.

Choosing and Checking a Transformation

A transformation is useful when its implied pattern is both supported by the data and defensible as a rating relationship. The model imposes a specific shape: for example, a log predictor makes equal multiplicative changes in \(x\) have equal effects on log mean, while a square-root predictor makes effects depend on differences in square roots. Compare fitted values at representative, meaningful predictor values rather than interpreting the coefficient in isolation.

Before adopting a transformation, check the following:

  • Domain and coding: \(\log x\) and \(1/x\) require positive \(x\); \(\sqrt{x}\) requires nonnegative \(x\). A shift for zero values must be explicit.
  • Units: Specify whether \(x\) is dollars, thousands of dollars, miles, or another scale. Report comparisons in those units.
  • Observed support: Inspect data coverage and fitted behavior across the range used for rating. A mathematically defined transformation does not make extrapolation reliable.
  • Practical action: Ask whether the resulting differences can be explained, reproduced in rating systems, and applied consistently to a risk’s recorded value.
  • Model assessment: Compare the transformed specification with plausible alternatives using appropriate fit and validation measures. A more symmetric predictor distribution, by itself, is not evidence that the conditional mean model is better.

A monotone transformation does not reorder observations if it is increasing, but it changes their spacing. A decreasing transformation reverses their order. Neither fact guarantees that the chosen relationship is appropriate, that predictions are stable at the extremes, or that a coefficient is causal. The fitted effect is conditional on the other model terms and on the specified model.

Key takeaway: State the transformation, its domain, and its units; then interpret a coefficient by comparing \(g(x_2)-g(x_1)\) and converting that difference to a fitted-mean ratio. This keeps the rating interpretation tied to actual predictor values.

Check Your Understanding

For each problem, hold other model terms and exposure fixed unless the question says otherwise.

  1. A hypothetical Poisson frequency GLM has a log link and term \(0.08\sqrt{x}\), with \(x\geq 0\). What is the fitted-mean ratio at \(x=16\) relative to \(x=1\)? (Answer: \(\exp(0.24)=1.2712\))
  2. A hypothetical frequency model has log link and term \(-0.12\log(x/100)\), where \(x\) is a positive annual amount in dollars. Find the fitted-mean ratio at \(x=800\) relative to \(x=200\). (Answer: \(\exp[-0.12\log(4)]=0.8468\))
  3. A model uses \(0.05\log(1+x)\) for a nonnegative predictor. Find the fitted-mean ratio at \(x=8\) relative to \(x=2\). (Answer: \(\exp[0.05\log(9/3)]=1.0565\))
  4. A model uses \(0.40/x\) for positive \(x\). Find the ratio at \(x=8\) relative to \(x=2\), and state whether the mean rises or falls. (Answer: \(\exp[0.40(1/8-1/2)]=0.8607\); it falls.)
  5. A model uses \(0.07\log(x/1000)\), where \(x\) is annual mileage in miles. Find the ratio at 30,000 miles relative to 10,000 miles. Why is the scale constant not responsible for the ratio? (Answer: \(\exp[0.07\log(3)]=1.0799\); the common denominator cancels in the transformed difference.)
Clinical Biostats