Actuarial Notes

Log-Linear Model

Study guide: Exam MAS-I

A Log-Linear Model is a Poisson regression for the counts in a contingency table, in which the logarithm of each cell's expected count is a sum of effects of the classifying variables and their interactions. In a table with I rows and J columns, the independence model for the expected count \mu_{ij} in row i and column j is

\ln \mu_{ij} = \beta_0 + \alpha_i + \gamma_j

  • \beta_0 is the intercept.
  • \alpha_i is the effect of row i and \gamma_j is the effect of column j, each set to 0 at a reference level.

This model has I + J - 1 parameters. It says the row and column variables are independent, and its fitted count in each cell is

\hat\mu_{ij} = \frac{y_{i\cdot}\, y_{\cdot j}}{n}

  • y_{i\cdot} is the total of row i and y_{\cdot j} is the total of column j.
  • n is the grand total of the observed counts y_{ij}.

The cell counts may be independent Poisson variables, or multinomial with the grand total fixed. Conditioning independent Poisson counts on their total gives the multinomial distribution, so the Poisson log-linear model gives the same fitted counts and tests under either.

600 closed claims are classified by whether they were litigated and whether they were large. What are the fitted counts under the independence model? The observed counts are:

Large Not large Total
Litigated 24 76 100
Not litigated 66 434 500
Total 90 510 600
  • Each fitted count is the row total times the column total, divided by 600.
  • The litigated row gets 100 \times 90/600 = 15 and 100 \times 510/600 = 85.
  • The not-litigated row gets 500 \times 90/600 = 75 and 500 \times 510/600 = 425.

Testing a log-linear model

The deviance of a log-linear model measures its lack of fit against the saturated model, which has one parameter per cell and deviance 0. The deviance is

D = 2 \sum_{i,j} y_{ij} \ln\!\left(\frac{y_{ij}}{\hat\mu_{ij}}\right)

and Pearson's chi-square statistic is

X^2 = \sum_{i,j} \frac{(y_{ij} - \hat\mu_{ij})^2}{\hat\mu_{ij}}

Each is approximately chi-squared with degrees of freedom equal to the number of cells less the number of parameters. For the independence model this is IJ - (I + J - 1) = (I-1)(J-1). A statistic below the critical value means the model fits.

In the claims table above, is litigation independent of claim size at the 5\% significance level?

  • The deviance is 2(11.280 - 8.506 - 8.437 + 9.095) = 6.86.
  • Each cell differs from its fitted count by 9, so X^2 = \frac{81}{15} + \frac{81}{85} + \frac{81}{75} + \frac{81}{425} = 7.62.
  • There are (2-1)(2-1) = 1 degree of freedom, with critical value 3.841.
  • Both statistics exceed 3.841, so independence is rejected. Litigation and claim size are associated.

The saturated model

Adding the interaction gives the saturated model, which reproduces every count exactly:

\ln \mu_{ij} = \beta_0 + \alpha_i + \gamma_j + (\alpha\gamma)_{ij}

  • (\alpha\gamma)_{ij} is the interaction of row i and column j, set to 0 when either is at its reference level.

Each cell's fitted value is the sum of the parameters that apply to it, so with two binary variables each of the four cells has its own mean.

In the claims table, with "not litigated" and "not large" as the reference levels, what is the interaction term of the saturated model?

  • The reference cell gives \beta_0 = \ln 434.
  • The litigated, not-large cell gives \alpha_{\text{lit}} = \ln(76/434), and the not-litigated, large cell gives \gamma_{\text{large}} = \ln(66/434).
  • The litigated, large cell gives \ln 24 = \beta_0 + \alpha_{\text{lit}} + \gamma_{\text{large}} + (\alpha\gamma).
  • Solving, (\alpha\gamma) = \ln\frac{24 \times 434}{76 \times 66} = \ln 2.077 = 0.731, the log of the odds ratio of the table.

Three-way tables

With three classifying variables A, B and C, terms are added hierarchically, and each model says which variables are independent:

Model Meaning
A + B + C All three variables are mutually independent.
AB + C A and B are associated, and the pair (A, B) is independent of C.
AB + BC A and C are independent given B.
AB + AC + BC Each pair is associated, with no three-factor interaction.
ABC The saturated model.

Two nested models are compared by the drop in deviance, which is chi-squared with degrees of freedom equal to the difference in their degrees of freedom (likelihood ratio test).

A 2 \times 2 \times 3 table of A, B and C gives deviance 14.0 on 6 degrees of freedom for AB + C and 4.1 on 4 degrees of freedom for AB + BC. Which model should be chosen at the 5\% significance level, and what does it say?

  • AB + C does not fit, because 14.0 exceeds the critical value 12.592 for 6 degrees of freedom.
  • Adding BC lowers the deviance by 9.9 on 2 degrees of freedom, above the critical value 5.991, so BC is kept.
  • AB + BC fits, because 4.1 is below the critical value 9.488 for 4 degrees of freedom.
  • Under AB + BC, A and C are independent given B.

Practice questions

Actuarial Notes