






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Applied Actuarial Statistics Class Test 2 Thursday, 15 November 2007 Suggested Solutions
(1) [4 points]
summary(chredlin) race fire theft age Min. : 1.00 Min. : 2.00 Min. : 3.00 Min. : 2. 1st Qu.: 3.75 1st Qu.: 5.65 1st Qu.: 22.00 1st Qu.:48. Median :24.50 Median :10.40 Median : 29.00 Median :65. Mean :34.99 Mean :12.28 Mean : 32.36 Mean :60. 3rd Qu.:57.65 3rd Qu.:16.05 3rd Qu.: 38.00 3rd Qu.:77. Max. :99.70 Max. :39.70 Max. :147.00 Max. :90. involact income side Min. :0.0000 Min. : 5.583 n: 1st Qu.:0.0000 1st Qu.: 8.447 s: Median :0.4000 Median :10. Mean :0.6149 Mean :10. 3rd Qu.:0.9000 3rd Qu.:11. Max. :2.2000 Max. :21.
hist(involact,br=10,freq=FALSE)
Histogram of involact
involact
Density
0.0 0.5 1.0 1.5 2.
The percentage considered minority varies from almost none to almost everyone in the com- munity. On the average, the proportion of the community having purchased FAIR plans is less than a percentage; the community with the most FAIR plans has only about 2.2% of
them with the plans. The distribution of this proportion with FAIR plans is highly skewed, as indicated by the histogram of involact, with more than a quarter of the communities with almost no FAIR plans. Median income for most communities appear to be fairly high, prob- ably not surprising since these are also households seeking to insure their pretty old housing units. In each community, as much as 65% have units built prior to 1939. The incidence of fires and thefts vary widely among the communities. At this point, it is difficult to assess the relationships of the variables.
(2) [12 points] Consider the simple linear model:
involact = β 0 + βracerace + ε.
(a) [4 points]
lm1 <- lm(involact ~ race) summary(lm1)
Call: lm(formula = involact ~ race)
Residuals: Min 1Q Median 3Q Max -0.7496 -0.2479 -0.1487 0.3129 1.
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.129218 0.096611 1.338 0. race 0.013882 0.002031 6.836 1.78e-08 ***
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
Residual standard error: 0.4488 on 45 degrees of freedom Multiple R-Squared: 0.5094, Adjusted R-squared: 0. F-statistic: 46.73 on 1 and 45 DF, p-value: 1.784e-
anova(lm1) Analysis of Variance Table
Response: involact Df Sum Sq Mean Sq F value Pr(>F) race 1 9.4143 9.4143 46.733 1.784e-08 *** Residuals 45 9.0653 0.
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
plot(involact ~ race, pch=20) abline(lm1,col="blue")
(a) [2 points] Transforming the income into its log removes some of the skewness observed in the income distribution. In addition, taking log considers the variable on a multiplicative scale so that interpretation is on a percentage basis, rather than direct pure dollar. This makes sense because the lower income groups value a dollar differently from the higher income groups - a $1,000 may be worth more to a poor person because it becomes a greater percentage of his wealth.
(b) [9 points]
A plot of the residuals from the previous model against the log of income is one ap- proach. This shows if log(income) can help explain some of the remaining unexplained variation through the residuals. Visually from the figure, it is difficult to detect any relationship. The correlation provides a little bit of numerical indication of a possible linear relationship.
plot(residuals(lm1) ~ log(income), pch=20) cor(residuals(lm1),log(income)) [1] -0.
l l
l
l
l
l
l l
l
l
l
l lll ll^ l
l
l
l
l
l
l
l l
l
l
l
l l
l
l
l l
l
l l
l l
l
ll
l
l
l
l
1.8 2.0 2.2 2.4 2.6 2.8 3.
−0.
log(income)
residuals(lm1)
The added variable plot provides an indication of the relationship between involact and log(income), which unlike the previous residual plot, it also controls for the effect of race. This plot shows some (negative) relationship between the residuals; the correlation helps to quantify this relationship.
resids1 <- lm1$residuals resids2 <- residuals(lm(log(income)~race)) plot(resids2,resids1,pch=20,main="added variable plot") abline(lm(resids1~resids2),col="blue") cor(resids1,resids2) [1] -0.
l l
l
l l
l
l l
l
l
l
l lll ll^ l
l
l
l
l
l
l
l l
l
l
l
l l
l
l
l
l
l
l l
l l
l
l l
l
l
l
l
−0.2 0.0 0.2 0.
−0.
added variable plot
resids
resids
The partial residual plot has a similar purpose as the added variable plot; it gives the relationship between involact and log(income) after controlling or removing the effect of race. The plot, just like previously, demonstrates the same (negative) relationship.
lm2 <- lm(involact ~ race + log(income)) prplot(lm2,2)
l l
l
l
l
l l l
l
l
l
l lll ll^ l
l
l
l
l l
l
l l
l
l
l
l
l
ll
l
l
l l
l l
l
l
l
l
l
l
l l
1.8 2.0 2.2 2.4 2.6 2.8 3.
−2.
−2.
−1.
−1.
log(income)
beta*log(income)+res
Finally, the coplot provides a picture of the relationship between involact and log(income), conditional on the race. Unlike the two previous plots (added variable and partial residual plots), coplots do not necessarily show linear relationships, but a more general relationship. Looking at the coplot figure below, it is not surprising to find nonlinear patterns in the relationship, given weak correlations previously demonstrated in the added variable and partial residual plots.
coplot(involact~log(income)|race,panel=panel.smooth)
Response: involact Df Sum Sq Mean Sq F value Pr(>F) race 1 9.4143 9.4143 52.0820 5.507e-09 *** log(income) 1 1.1118 1.1118 6.1508 0.01703 * Residuals 44 7.9534 0.
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
(d) [4 points] Insurers could argue that, regardless of the proportion of minority in the community, insurance is being denied based on the level of income, to ensure consumers could afford to pay the price of protection. However, both race and income present political difficulties for using them as basis for providing protection. On the other hand, consumer advocates could argue that regardless of the level of income of the community, the insurers are denying coverage on the basis of race (redlining).
(4) [39 points] Insurers may claim they were denying insurance in neighborhoods where there had been large fire and theft related losses. Now consider then the regression model which controls for the effects of these losses, including age being used as an insurer’s pricing variable:
involact = β 0 +βracerace+βlog(income)log(income)+βfirefire+βthefttheft+βageage+ε.
(a) [3 points] Summary results below, together with the ANOVA constructed from R.
lm3 <- lm(involact~race+log(income)+fire+theft+age) summary(lm3)
Call: lm(formula = involact ~ race + log(income) + fire + theft + age)
Residuals: Min 1Q Median 3Q Max -0.85393 -0.16922 -0.03088 0.17890 0.
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.185540 1.100255 -1.078 0. race 0.009502 0.002490 3.817 0.000449 *** log(income) 0.345762 0.400123 0.864 0. fire 0.039856 0.008766 4.547 4.76e-05 *** theft -0.010295 0.002818 -3.653 0.000728 *** age 0.008336 0.002744 3.038 0.004134 **
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
Residual standard error: 0.3345 on 41 degrees of freedom Multiple R-Squared: 0.7517, Adjusted R-squared: 0. F-statistic: 24.83 on 5 and 41 DF, p-value: 2.009e-
anova(lm3) Analysis of Variance Table
Response: involact Df Sum Sq Mean Sq F value Pr(>F) race 1 9.4143 9.4143 84.1255 1.741e-11 *** log(income) 1 1.1118 1.1118 9.9352 0.003028 ** fire 1 1.3117 1.3117 11.7210 0.001414 ** theft 1 1.0208 1.0208 9.1221 0.004334 ** age 1 1.0327 1.0327 9.2279 0.004134 ** Residuals 41 4.5882 0.
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
(b) [5 points]
The ANOVA Table source sum of squares (SS) d.f. mean square (MS) F-ratio
regression 13.8913 5 2.77826 24. 82806 error 4.5882 41 0. total 18.4795 46
The F -ratio, equal to the ratio of the regression MS to the error MS, from the ANOVA table is used to test for model adequacy, i.e. that there is at least one variable able to explain the variation. The table also reveals how much of this variation is being explained by the model; in particular, the ratio regression SS to total SS, here equal to 75%, provides this proportion explained. (c) [8 points] From the above summary, we find R^2 = 75.17% and R^2 a = 72.14%. 75.17% of the total variability in number of people being denied insurance (per 100 housing units) is explained by the regression model; only 72.14% of the total variability is explained by the model, after adjusting for the number of predictor variables in the model. In comparing models, often used is the R a^2 because which unlike R^2 which never decreases when extra predictors are added, it contains a correction for the degrees of freedom. Indeed, R^2 a decreases when extra insignificant predictors are introduced.
(d) [10 points]
We want to test H 0 : βfire = βtheft = βage = 0 against the alternative that there is at least one of these beta’s not equal to zero. The test statistic is the partial F -statistic given by:
Testing for significance of a single predictor is a t test. The summary results above shows a p-value of 0.000449, small enough for us to comfortably reject the null H 0 : βrace = 0. This says that despite controlling for fire and theft, race is still a significant predictor for the number of people being denied insurance.
(5) [20 points] Finally, consider the addition of the effect of the side indicator variable:
involact = β 0 +βracerace+βlog(income)log(income)+βfirefire+βthefttheft+βageage+βsideside+ε.
(a) [4 points] The estimated coefficient of brace = 0.009330 gives the additional number of people denied insurance whenever there is a percentage increase in minority in a community.
lm4 <- lm(involact~race+log(income)+fire+theft+age+side) summary(lm4)
Call: lm(formula = involact ~ race + log(income) + fire + theft + age + side)
Residuals: Min 1Q Median 3Q Max -0.84832 -0.17365 -0.01962 0.17067 0.
Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.190806 1.114419 -1.069 0. race 0.009330 0.002847 3.277 0.00217 ** log(income) 0.343419 0.405406 0.847 0. fire 0.039994 0.008936 4.475 6.19e-05 *** theft -0.010227 0.002899 -3.528 0.00107 ** age 0.008423 0.002857 2.948 0.00532 ** sides 0.016287 0.124922 0.130 0.
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
Residual standard error: 0.3386 on 40 degrees of freedom Multiple R-Squared: 0.7518, Adjusted R-squared: 0. F-statistic: 20.2 on 6 and 40 DF, p-value: 1.059e-
anova(lm4) Analysis of Variance Table
Response: involact Df Sum Sq Mean Sq F value Pr(>F) race 1 9.4143 9.4143 82.1085 3.06e-11 *** log(income) 1 1.1118 1.1118 9.6970 0.003405 ** fire 1 1.3117 1.3117 11.4400 0.001618 **
theft 1 1.0208 1.0208 8.9034 0.004834 ** age 1 1.0327 1.0327 9.0067 0.004616 ** side 1 0.0019 0.0019 0.0170 0. Residuals 40 4.5863 0.
Signif. codes: 0 ’’ 0.001 ’’ 0.01 ’’ 0.05 ’.’ 0.1 ’ ’ 1
(b) [3 points] The estimate of the variance of the “error” term in the model can be drawn from the ANOVA table. This is the residual MS, which according to the table is equal to 0.1147. This estimate is used for calculating standard errors for the slope estimates, and is also useful for hypothesis testing and for constructing confidence/prediction intervals. (c) [4 points] The summary results reveals a p-value, corresponding to the variable side, of 0.89692. This is too large a p-value to be able to comfortably reject the null hypothesis H 0 : βside = 0. Thus, we do not reject the null and say there is not enough evidence that there is difference in involact between the north and south side of Chicago. (d) [4 points] The F -statistic is equal to 20.2 and is used to test the adequacy of the model, that is, there is at least one significant variable in the model for it to be useful. This corresponds to a p-value of 1.059e-10, and hence we can reject the null that all the beta coefficients are zero. The model is indeed adequate. (e) [5 points] An interaction term in a regression model is usually the product of a continuous variable (say race) and a binary variable (say side). It is being added in situations where we believe there is a significant difference in the slope between the values of the binary variable. For example, in this context, if we believe that the coefficient of race is different between the south and north side, then an interaction term would be necessary. If race is already an important predictor of the number of people being denied insur- ance, the addition of an interaction term will simply tell about how much more or less different is this between the two sides of town. So this will not help consumer advocates. The insurer is interested in removing the presence of race in the equation, so that an interaction term is not something they would be interested in. The insurer may want to prove that race may be significant on one side of town, but not on the other; however, an interaction term does not help here either.
(6) [5 points]
There are many other items that one can do to further validate the claims in the regression analysis: