Analysis of Covariance
Study guide: Exam MAS-I
An Analysis of Covariance (ANCOVA) is a normal linear model whose predictors are a categorical factor and a continuous variable, the covariate, so that it fits a regression line in the covariate for each level of the factor. For a factor with J levels, level 1 as the base level, and covariate x, the mean response with a common slope is
\mu = \beta_0 + \beta_1 x + \gamma_2 I_2 + \cdots + \gamma_J I_J
I_jis the indicator of levelj.\beta_0and\beta_1are the intercept and slope of level 1.\gamma_jis the difference between the intercept of leveljand that of level 1.
The lines for the levels are parallel. At every value of x, level j differs from level 1 by \gamma_j. With every \gamma_j = 0 the model is a single regression line, and with \beta_1 = 0 it is a one-way analysis of variance. The levels are compared after adjusting for the covariate, usually at its overall mean \bar{x}.
A common-slope model of log severity is
\hat\mu = 7.20 + 0.25 I_B + 0.40 I_C + 0.030x, with territory A as the base level and vehicle valuexin thousands. The overall mean vehicle value is 15. What are the territories' adjusted means?
- At
x = 15, the covariate adds0.030 \times 15 = 0.45for every territory.- Territory A's adjusted mean is
7.20 + 0.45 = 7.65.- Territory B's is
7.20 + 0.25 + 0.45 = 7.90, and territory C's is7.20 + 0.40 + 0.45 = 8.05.- The differences between territories are
0.25and0.40at every vehicle value, because the lines are parallel.
Separate slopes for each level
Adding the factor-by-covariate interaction gives each level its own slope, so the mean response is
\mu = \beta_0 + \beta_1 x + \sum_{j=2}^{J} \gamma_j I_j + \sum_{j=2}^{J} \delta_j\, x I_j
\delta_jis the difference between the slope of leveljand that of level 1.
The difference between level j and level 1 is \gamma_j + \delta_j x, which changes with the covariate, so no single difference describes the levels.
In a separate-slopes model, level 2 has
\gamma_2 = 0.5and\delta_2 = -0.02. What is the difference between level 2 and level 1 atx = 10and atx = 40?
- At
x = 10, the difference is0.5 - 0.02(10) = 0.3.- At
x = 40, the difference is0.5 - 0.02(40) = -0.3, so the order of the two levels is reversed.
Testing for parallel lines and a factor effect
The common-slope model has J + 1 parameters, and the separate-slopes model has 2J. The models are nested, so each question is answered by the F test for nested models:
- Test for parallel lines,
H_0\colon \delta_2 = \cdots = \delta_J = 0, by comparing the common-slope model with the separate-slopes model, onJ - 1andn - 2Jdegrees of freedom. - If the lines are parallel, test for a factor effect after adjusting for the covariate,
H_0\colon \gamma_2 = \cdots = \gamma_J = 0, by comparing the covariate-only model with the common-slope model, onJ - 1andn - J - 1degrees of freedom. The denominator is the residual mean square of the common-slope model.
Log severities of 24 claims, 8 from each of 3 territories, are fitted with vehicle value as the covariate. The covariate-only model has RSS 18.0, the common-slope model 12.0 and the separate-slopes model 11.1. At the 5% level, are the lines parallel, and do the territories differ?
- The separate-slopes model has
2J = 6parameters, so24 - 6 = 18residual degrees of freedom, and it addsJ - 1 = 2slope differences.- For parallel lines, the numerator is
(12.0 - 11.1)/2 = 0.45and the denominator is11.1/18 = 0.6167, soF = 0.73.0.73is below3.555, the 5% critical value ofFwith 2 and 18 degrees of freedom, so the common slope is kept.- The common-slope model has
J + 1 = 4parameters, so24 - 4 = 20residual degrees of freedom.- For the territory effect, the numerator is
(18.0 - 12.0)/2 = 3.0and the denominator is12.0/20 = 0.6, soF = 5.0.5.0is above3.493, the 5% critical value ofFwith 2 and 20 degrees of freedom, so the territories differ in expected log severity at the same vehicle value.