Actuarial Notes

ANOVA

Study guides: Exam MAS-I, Exam ACIA-CAPSTONE

ANOVA, the analysis of variance, is the division of the total sum of squares of a response into the part a model explains and the part it leaves unexplained, used to test whether the model explains any of the variation. Regression software prints the division as an ANOVA table. For a linear regression with an intercept, p predictors and n observations, the ANOVA table is:

Source Sum of squares Degrees of freedom Mean square
Regression \text{TSS} - \text{RSS} p (\text{TSS} - \text{RSS})/p
Residual \text{RSS} n - p - 1 \text{RSS}/(n - p - 1)
Total \text{TSS} n - 1

In both the sum of squares and the degrees of freedom columns, the regression and residual rows add up to the total row. The residual mean square is \hat\sigma^2, the estimate of the error variance. The test of H_0\colon \beta_1 = \cdots = \beta_p = 0, that no predictor is related to the response, against the alternative that at least one \beta_j is not zero, uses the statistic

F = \frac{(\text{TSS} - \text{RSS})/p}{\text{RSS}/(n - p - 1)}

  • Under H_0, F has an F distribution with p and n - p - 1 degrees of freedom.

H_0 is rejected at level \alpha when F exceeds the upper-\alpha critical value of that distribution. Software output gives p as the numerator degrees of freedom of F and n - p - 1 as the residual degrees of freedom, from which n follows.

A regression with 2 predictors and an intercept is fitted to 50 observations, with \text = 1000 and \text = 320. Is the regression significant at the 5% level?

  • The regression sum of squares is 1{,}000 - 320 = 680 on p = 2 degrees of freedom, a mean square of 340.
  • The residual sum of squares is 320 on 50 - 2 - 1 = 47 degrees of freedom, a mean square of 6.8.
  • F = 340/6.8 = 50.
  • The 5% critical value of F with 2 and 47 degrees of freedom is 3.195, so H_0 is rejected: at least one predictor is related to the response.

One-way analysis of variance

One-way ANOVA tests whether the means of J groups are equal. It is the regression of the response on J - 1 group indicators, so the regression sum of squares is the between-group sum of squares, and the RSS is the within-group sum of squares \sum_j \sum_i (y_{ij} - \bar{y}_j)^2. The statistic is

F = \frac{(\text{TSS} - \text{RSS})/(J - 1)}{\text{RSS}/(n - J)}

  • \bar{y}_j is the mean of group j, and n is the total number of observations.
  • Under H_0 that all the group means are equal, F has an F distribution with J - 1 and n - J degrees of freedom.

When H_0 is rejected, multiple comparison procedures find which means differ. Adding a continuous covariate to the group indicators gives an analysis of covariance.

Claim severities from three territories, 10 claims each, give a between-group sum of squares of 1,200 and a within-group sum of squares of 5,400. Do the mean severities differ at the 5% level?

  • The between-group mean square is 1{,}200/(3 - 1) = 600.
  • The within-group mean square is 5{,}400/(30 - 3) = 200.
  • F = 600/200 = 3.0.
  • The 5% critical value of F with 2 and 27 degrees of freedom is 3.354, so H_0 is not rejected: the data do not show different mean severities.

F test for nested models

To test whether q of the coefficients of a model with p predictors are all zero, the restricted model without them is compared with the full model by the statistic

F = \frac{(\text{RSS}_0 - \text{RSS})/q}{\text{RSS}/(n - p - 1)}

  • \text{RSS}_0 is the residual sum of squares of the restricted model, and \text{RSS} is that of the full model.
  • Under H_0, F has an F distribution with q and n - p - 1 degrees of freedom.

The overall test is the case q = p, in which the restricted model has only the intercept and \text{RSS}_0 = \text{TSS}. A sequential ANOVA table lists, for each predictor in the order it entered the model, the drop in RSS from adding it, so a predictor's row depends on the predictors entered before it.

With 24 observations, a model with 1 predictor has \text_0 = 18.0. Adding a 3-level factor, as 2 indicators, gives \text = 12.0. Is the factor significant at the 5% level?

  • The full model has p = 3 predictors, so its residual degrees of freedom are 24 - 3 - 1 = 20.
  • The numerator is (18.0 - 12.0)/2 = 3.0 and the denominator is 12.0/20 = 0.6, so F = 5.0.
  • The 5% critical value of F with 2 and 20 degrees of freedom is 3.493, so the factor is significant.

Analysis of deviance

A generalized linear model is compared with a smaller model nested in it by the change in deviance. Scaled by the dispersion parameter \phi, the change is approximately chi-squared:

\frac{D_0 - D}{\phi} \sim \chi^2_q

  • D_0 is the deviance of the smaller model and D that of the larger model.
  • q is the number of parameters the larger model adds, which is the difference in their residual degrees of freedom.

A categorical predictor with J levels adds J - 1 parameters. For the Poisson and binomial distributions \phi = 1, so the change in deviance itself is compared with the chi-squared critical value. When \phi is estimated, the statistic F = (D_0 - D)/(q\hat\phi) is compared with an F distribution. A significant drop in deviance means the added terms are needed, and otherwise they can be dropped.

A Poisson log-linear model has deviance 25.3 on 12 degrees of freedom. Adding an interaction gives deviance 14.1 on 9 degrees of freedom. Is the interaction needed at the 5% level?

  • The change in deviance is 25.3 - 14.1 = 11.2 on 12 - 9 = 3 degrees of freedom.
  • The 5% critical value of \chi^2_3 is 7.815.
  • 11.2 > 7.815, so the interaction is needed.

Practice questions

Actuarial Notes