Actuarial Notes

Missing Data

Study guides: ATPA, DISC-DA, Exam PCPA, ACIA-M2, Exam ACIA-CAPSTONE

Missing Data are values of a variable that were never recorded for some observations. How they are handled depends on why they are missing, because the mechanism decides whether dropping or filling them leaves the model unbiased.

The missing rate of variable j over n observations is

\text{Missing rate}_j = \frac{\#\{i : x_{ij} \text{ missing}\}}{n}

  • x_{ij} is variable j for observation i.

Compute the rate for every variable during Exploratory Data Analysis, and look for missing values in disguise: a 0 age, a 9999 year built, a blank territory code. A search for nulls will not find these, so look at each variable's distribution for impossible values.

Types of missing data

  • MCAR (missing completely at random): the chance of being missing is unrelated to anything, observed or not. Dropping those rows loses data but introduces no bias.
  • MAR (missing at random): missingness depends on other observed variables, for example prior-carrier information missing more often for business written through one channel. It can be handled by modelling it from those variables.
  • MNAR (missing not at random): missingness depends on the missing value itself, for example applicants with poor credit declining to provide it. Dropping or naively filling these values biases the model.

A missing value is often a signal in its own right.

Treatments of missing data

  1. Complete-case analysis drops every row with a gap. It is simple, but it can discard a large share of the data and is biased unless the data are MCAR.
  2. Imputation fills gaps with the median, the mean or a model prediction. It keeps the rows but understates variability.
  3. For a categorical predictor, an explicit "Unknown" level lets the GLM estimate the effect of missingness directly.
  4. For a continuous predictor, impute the value and add a missing-value indicator.

Whatever is chosen has to be stated in the report, and it must be applied in exactly the same way when the model is used to score new business.

How should the coefficient of this Unknown level be interpreted? In a homeowners frequency GLM (log link), roof age is missing for 9\% of policies. Binned roof age is fitted with an "Unknown" level, which gets a coefficient of 0.18 relative to the base level (roofs 0–10 years old).

Answer

  • Under a log link the coefficient becomes a relativity, e^{0.18} = 1.197.
  • Policies with no recorded roof age have about 20\% higher expected frequency than new roofs, all else equal, so missingness is predictive. Roof age may go unrecorded mostly on older homes bought without an inspection.
  • Had these rows been dropped, the model would have learned nothing about them and would have priced them at the average, undercharging the group.

What goes wrong when this analyst drops every row with missing prior history? Prior claim history is missing for all policies written in their first year with the company, and first-year policies have higher frequency.

Answer

  • Missingness is tied to tenure, and tenure is tied to risk, so the data are not MCAR.
  • Dropping the rows removes all first-year business, and with it the higher-frequency risks.
  • The model then understates the overall level, and it can never price a new customer.
  • The better treatment keeps the rows and codes prior history as "none on file", a level of its own. The model can then price new business, and the difference between a new customer and a claim-free renewal becomes a coefficient the actuary can inspect.

Null values in SQL and R

In SQL a missing value is a null, an unknown value, and it behaves differently from zero or a blank:

  • A comparison with a null, such as deductible = NULL or deductible <> 500, gives null rather than true or false, so a WHERE condition never keeps the null rows. Test for them with IS NULL and IS NOT NULL.
  • COUNT(*) counts every row, while COUNT(column) counts only the non-null values, and SUM, AVG, MIN and MAX use only the non-null values. A sum over no rows is null, not zero.
  • COALESCE(column, value) returns the first of its arguments that is not null, which substitutes a default where the value is missing.
  • A null key never matches in a join, so rows with null keys drop out of an inner join.

In R a missing value is NA, which is unknown like a null rather than zero. mean() and sum() return NA unless told to remove missing values (na.rm = TRUE). A dataframe in pandas tests for nulls with isna() and notna().

Treating a null as zero AVG ignores nulls, so it divides by the number of non-null values. Treating a null paid amount as zero lowers the average, and dropping the row changes the count.

Practice questions

Actuarial Notes