0 ratings 0% found this document useful (0 votes) 13 views 16 pages GLM Notes
The document discusses weighted least squares estimators and their properties, particularly in the context of insurance data analysis. It contrasts grouped and ungrouped data approaches for regression analysis, emphasizing the advantages of using raw observations over summary tables. Additionally, it covers transformations for normality and linearity, categorical explanatory variables, polynomial regression, and the concept of interaction in linear models.
AI-enhanced title and description
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
48, Linear modeling
Thus the weighted observations are homoskedastic since Var(e7) = 07.
Regressing y} on the xj, yields
BY = (XY X*) IXY? = (X'WX) OX Wy, (4.17)
where W is the diagonal matrix with diagonal entries w;. The estimator 3*
is called the weighted least squares estimator. Since (3° is the least squares
imator computed relative to the model y* = X* + ¢* it follows that
BY ~N {B,0%(X'WX)"}
Weighted least squares estimators have all the desirable properties of least
squares estimators, provided of course correct weights are used.
4.8 Grouped and ungrouped data
Insurance data are often represented in tabular or grouped format. As an exam-
ple, consider an analysis of claim sizes in the vehicle insurance data, by age
and sex of the driver. For policies which had a claim, mean claim sizes by age
and sex are
en in Table 4.1. For male drivers, mean claim size decreases
with increasing age, For female drivers the pattern is not as clear. The ques-
tion arises as to the appropriate analysis for data in this form. Although there
are 12 cells of data, the table is based on the 4624 policies which had a claim.
A regression analysis with claim size as the response, and driver's age and
sex as explanatory variables, is appropriate. This may be carried out in two
ways:
(the “grouped data” approach. This is based on the 12 observations in
‘Table 4.1, with regression weights equal to the number of observations
in each cell;
ii) the “ungrouped data” approach. This is based on the 4624 raw
observations.
The two approaches yield the same parameter estimates. The grouped data
approach has been, and still is, popular, as data representation and storage is
dramatically simpler in cases such as the current example. Computation is also
simplified. However, in realistic analyses many explanatory variables are typi-
cally considered, meaning that the summary table is highly multidimensional.
In addition, with modern computing the saving in compytation time is mini-
mal, Thus while a summary table such as Table 4.1 is a useful preliminary data
inspection tool, its use in analysis does not present any advantage over use of
the raw observations: In any case, if there is at least one explanatory variable
which is continuous, then the grouped data approach cannot be used.
‘The ungrouped data approach is used throughout this text, i.e, analyses are
performed on the basis of raw observations such as individual policies. The4.9 Transformations to normality and linearity 49
Table 4.1. Vehicle insurance: mean claim size (dollars) by age and sex of
driver, number of observations in brackets
i ers age categor
e 1 O03 es
Male 2118 1945 1869 1800 1724 1546
(276) (537) (688) (643) (322) (182)
Female 3285 2381 1991 2143 1734 2198
(220) 395) (425) (461)_(292)_(183)
grouped and ungrouped approaches are contrasted in the context of logistic
regression, in Section 7.
4.9 ‘Transformations to normality and linearity
Transformations of the response and explanatory variables are frequently car-
ried out in order to view and analyze data on an appropriate scale. This has
been discussed in Section 1.3. When performing a linear regression, data is
transformed in order to satisfy the model assumptions of linearity between y
and the explanatory variables, homoskedasticity and normality of ¢. While
normality of the explanatory variables is not necessary, when an variable is
strongly skewed a linear relationship with y is unlikely. Transformations which
normalize, or at least symmetrize, the distribution of an explanatory variable
frequently also linearize its relationship with y or some transform of y.
Third party claims. Consider a model for the number of claims in an area
as a function of the number of accidents. A scatterplot of claims against acci-
dents is shown in the left panel of Figure 4.1, This is strongly heteroskedastic.
Diagnostic checks on a linear model based on these data indicate clear viola-
tion of the homoskedasticity assumption, The concentration of points around
the origin make it difficult to discern the relationship between y and x. The
top two panels of Figure 4.2 show the histograms of the number of accidents
and the number of claims, Both are strongly skewed to the right. The bottom
two panels are histograms of the log-transformed data, which appear more
normal than those of the raw data, A scatterplot of the log-transformed data
is shown in the right panel of Figure 4.1. This displays linearity and approx-
imate homoskedasticity, and therefore a linear model based on log claims as,
the response and log accidents as the explanatory variable, is more amenable
to analysis using the normal linear model than one based on the raw data.
‘A GLM analysis is more appropriate for these data and is discussed in
Section 6.2.50 Linear modeling
a ; ° ;
8 | a.
Be a
& a,
& 2600000 6000 8000 7s 6 8
‘cients Log accionts
Fig. 4.1. Scatterplots of number of accidents and number of claims, raw and log scales
]
84) 8
at 28
3. Be
. o (MMlana = a2
3 2000” ado0 " edo
lains
8 2
Bo ce
&= e
8 . oid
etrrre stertree
Log acients Log elie
Fig. 4.2. Histograms of number of accidents and number of claims, raw and log scales
ing transformations. The above example demonstrates the
use of the logarithmic transformation to both stabilize the variance of y and
linearize its relationship with «. If the variance of y is of the form Var(y) =
$H?, where @ > 0 is a scale parameter, then the transformation g(y), which
makes the variance approximately independent of the mean, is such that the
derivative of g(y) with respect to y is y~?/?. This is established from
oy) 9(H) + G(H(y-H) => ——Var{o(u)} © {5(u)}PVar(y) »4.10 Categorical explanatory variables st
where g(y) is the derivative of g evaluated at y. Integrating (1) = w-?/? with
respect to 1 yields
go)
{ y 2 forp #2
In(y)— forp=2.
This is the Box-Cox transformation described in Section 1.3. As an example,
when y has variability proportional to the mean (such as in the case of Poisson.
data), Var(y) = dy, p = 1 and hence the variance stabilizing transform is
gy) = VJ. If the standard deviation is proportional to the mean and hence
p = 2, then the log transform stabilizes the variance.
Variance stabilizing transformations were important before the GLM
methodology became available, When non-normal responses were modeled,
the only option was to find a transformation which would render the data
amenable to analysis using the normal linear model. For example, when ana-
lyzing count data which had the Poisson distribution, a normal linear model
analysis was performed using the square root of y as the response. With GLMs
the data is modelled directly, using the appropriate response distribution.
4.10 Categorical explanatory variables
When a potential explanatory variable is categorical, then it is “dummied up”
for inclusion into a multiple linear regression, For example, suppose the area of
residence of a policyholder is considered to be a potential explanatory variable
in a model for claim size y. If there are three areas A, B and C, then two
indicator (dummy) variables «7 and za are defined:
‘Suppose area is the only explanatory variable. Then the relationship is modeled
as
¥ © Bo+ Bras + Bowe -
This states that y = ip in area C, y © By + Br in area A, and y © By + Be
in area B. Thus is the difference between areas C and A, while (3 is the
difference between areas C and B. Note the following:
(i) An indicator variable 273 for C is not used. The “left out” category
is called the base level. In the above example, area C is the base level,52 Linear modeling
meaning that differences are measured between C and cach of the other
levels. The choice of base level is up to the analyst: this is discussed in
more detail below.
(ii) In general, when the explanatory variable has r levels, r — 1 indi-
cator variables are introduced, modeling the difference between each
category and the base level.
(iii) IL is not sensible to define, for example, a variable « = 1,2 or 3 accord-
ing to whether the level is A, B or C, since y © Bg + Ait implies equal
spacing between A, B and C, i.e. a difference of Ay between arcas A
and B; and 3; between areas B and C.
Choice of base level. The base level should not be sparse. To explain this
suppose one has a categorical explanatory variable with r levels, and level r
has been chosen as the base level. In the extreme scenario, if there are no cases
having level r then for each case one of «1,...,2,-1 is always equal to 1,
and the others equal to zero. This in turn implies that ary +--+ + 2p—1 = 1
and hence the X matrix is singular: the sum of the last r — 1 columns equals
the intercept. More realistically, if the base level has very few cases, then for
most cases sry +++++ar1 = 1, implying near linear dependency between the
columns of X. Although @ is computable, it would be numerically unsta-
ble, analogous to the result obtained when dividing by a number close to
zero.
Any level which is not sparse is an appropriate base level. Since 8; is the
difference in the effect of the explanatory variable at level j compared with the
base level, it is convenient to choose the base level as the “normal” or “usual”
level, against which other levels are to be compared. This is often the level
having the most cases. For example, in the vehicle insurance data set, the most
commonly occurring vehicle body type is “Sedan,” which comprises almost a
third of the cases. Comparing other body types with Sedan makes good sense,
and makes the latter a good choice as the base level. Note, however, that one
is not limited to making comparisons relative to the base level. Differences
between non-base levels are of the form 8; — Bx.
SAS notes. The software chooses the base level as the highest level ~ numer-
ically or alphabetically. When levels are coded numerically, the highest level
is often the category “Other.” This is not a good choice of base level as it is
usually sparse, and comparisons relative to “Other” are generally not helpful.
In this case a more suitable base level needs to be specified. The terminology
for base level in the SAS manual is “reference level.”4.11 Polynomial regres
ion 53
4.11 Polynomial regression
Given a single explanatory variable x consider
y © Bo + Aix + Box
This is a linear regression since the right hand side is linear in the 3 coeffi-
cients. The relationship between y and x, however, is quadratic. In essence
there is one explanatory variable, albeit used twice in different forms. A unit
increase in a: has the effect of changing y by about ( ++ 22. and hence the
slope of the relationship depends on the value of «x.
‘This idea can be extended by defining further variables «°, 2, and so
on, Incorporating more polynomial terms permits an increasingly complicated
response structure. When a polynomial term of degree m, ic. x”, is included
in a model, all lower order terms x, x”, ... ,2”"—? are generally included. Note
that fitting polynomials of an order which is unnecessarily high, results in
models with fitted values close to the observations but low predictive ability.
This is illustrated in Figure 4.3, in which a small data set (n = 20), simu-
lated with a quadratic relationship between x and y, has had polynomials of
degree m = 1,2, 10 and 19 fitted. Clearly the linear relationship (m = 1) is
m=
si is 2
mat
we
ob & 2
Fig. 4.3. Polynomial fits, simulated data set
inappropriate; m = 2 approximates the general shape of the relationship, with-
out following local variation too closely; mm = 10 produces fitted values much
closer to the observations, but which tend to follow small local variations; and
‘m = 19 (which fits 20 parameters to 20 observations) produces a perfect but
useless fit, which “joins the dots.” The As from the degree 10 fit will have
lower precision, and the resulting fitted values will be less reliable, than those
from the quadratic model, Judgement about what degree of polynomial to fit to54 Linear modeling
a continuous explanatory variable is guided by significance testing of the coef
ficients (Section 4.15), and model sclection criteria (Section 4.19). Typically
‘one starts with a linear term, and adds in increasingly higher order terms. This
is illustrated, in the context of logistic regression, in Section 7.3.
Numerical difficulties. These can arise when high order terms are included
in a model, due to the finite length of computer storage. If « is large (negative
or positive), then overflow occurs in the computation of x” when m is large
Frequently a further result of this is that underflow occurs in the corresponding
A. This problem is avoided if « is suitably scaled before entering it into the
regression. Specifically, denoting max as the maximum value of x in the data,
and min as the minimum, then (max + @min)/2 is the midrange of x, and
(max nin) /2 is half the range of x. The linear transformation
Bmin)/2
lies between —1 and 1, Overflow and underflow problems are overcome by
including 2* rather than « in the polynomial regression.
Further problems of collinearity (see Section 4.14) can arise when comput
ing high order polynomial regressions. Successive powers of «x may be highly
correlated, leading again to numerical instability and consequent unreliability
of the estimates. This problem is avoided by the use of orthogonal polynomi-
als. Interested readers are referred to Chambers and Hastie (1991). Orthogonal
polynomials are used in a regression model for mortality in Section 6.2.
4.12. Banding continuous explanatory variables
‘When the relationship between explanatory variable and response is not linear
an alternative, safer, approach to finding a parametric form of the relationship
is to band or categorize the explanatory variable. Although banding results
in loss of information, a model employing a banded version of a continuous
variable is sometimes considered more practical than one which employs the
(possibly misspecified) continuous variable. However, caution is required in
the choice of cutoffs and there is no general rule as to the optimal choice of
cutoffs.
© Excessively wide bands hide important features,
Each band must have adequate numbers to ensure stable estimates.
© Ideally bands correspond to realistic groups. For example, external factors
such as industry standards can guide appropriate levels of banding.
‘An example of banding a continuous explanatory variable in the context of
logistic regression is given in Section 7.3.4.13 Interaction 355
4.13 Interaction
Consider the model with two explanatory variables x, 22 and with
Y Bo + Ares + Pasta + Byrne
This is a linear regression with x3 = 229, called an interaction term. A unit
increase in 21 increases y by about (iy + yaa, and hence the effect of 1
depends on 272. Similarly the effect of a unit increase in «2 is about (22 + 8321
which depends on 1. Thus speaking of the effect of a unit increase in, for
example, 27, holding all other variables constant, does not make sense. The
variables xy and 2° are called the main effects and are distinguished from the
interaction effect 3 = ear.
Interacting an ordinary quantitative variable with an indicator variable is a
useful technique of linear modeling. Assume 2 is continuous, and 2 is an
indicator taking on the values 0 and 1 (indicating one of two groups). Then
v={ Bot Arey if ry
(Bo + 82) + (i + Bs)a1 ife
Thus the effect of zz, that is the intercept and slope ~ depends on the group
indicated by «2. For the base group 2 = 0, the intercept and slope of the
relation of y to zr are (iy and (41, respectively. The intercept and slope when
©2 = 1 are fp + fz and f, + 3. Hence these are an increase of 2 and Bs
relative to the intercept and slope when «2 = 0. This modeling idea is easily
extended to more than two groups and a number of quantitative variables, so
that the intercept and slopes with respect to quantitative variables may differ
across many groups.
As an illustration of interaction, the age of a driver may have an effect on
the probability of a claim, but this effect may differ according to whether the
car is a sports car or otherwise. More generally the effect of the age of a driver
may vary with the type of car.
4.14 Collinearity
Consider the effect of smoking on mortality. ‘The following explanatory
variables are available: 2; the age at which smoking commenced, x2 the
number of years since smoking initiation and 23 the current age. Obviously
tg = 0) +2) and
Bo + Bre + Bote + Byars = Bo + (1 + is) + (Ba + Bs)ra -
Hence the three variables 21, :r and ars explain the same as any two of the
variables. Thus the individual effects of each of the three variables cannot be
assessed. The variables are perfectly “collinear.” In terms of the multiple least
squares model (4.6), the matrix X has an exact linear dependence between its
columns and hence X’X is singular.56 Li
near modeling
Using perfectly collinear variables. Many programs, when encountering
perfect linear dependence in variables, exclude one or more variables to ensure
the perfect collinearity disappears. Alternatively the software may just “crash”
or even worse, report nonsensical results.
Near collinearity. The smoking example above is a case of exact collinearity.
Itis more usual (0 encounter situations of “near” and less obvious collinearity.
For example, in a data set where the
‘ases are policyholders, area of resi-
dence, income level and education level will be correlated. The result of the
inclusion of highly correlated explanatory variables is the near singularity of
X'X and difficulties in the computing the inverse (X'X)~!. If the inverse is.
computable, then it will typically have large diagonal entries, implying large
estimation variances on one or more of the components of f. The existence
of collinearity may also mislead the analyst in the choice of explanatory vari-
ables. If 2; and, are highly correlated and both predictive of the response,
then each one, in the presence of the other, will not contribute much additional
explanation. Hypothesis tests for each variable, assuming that the other one is
in the model, will show non-significance, The solution is to include only one
of them in the model.
4.15. Hypothesis testing
Isa given coefficient J; equal to zero? This is equivalent to asking whether 7;
is relevant to the prediction of the response. More generally it may be asked if
a group of coefficients are all zero i.e. if, for a given “hypothesis” matrix Cit
is the case that C8 = 0. For example, if C picks out the trailing coefficients
in:
0 o10 0
Oo--. oOo1 0
Cc ,
O- 000-1
then the hypothesis {8 = 0 is the hypothesis that the final coefficients in are
all zero. More generally it may be asked whether a given coefficient is equal to
some number different to zero, or whether for example the sum of coefficients
equal a given number. All these hypotheses can be written as C3 = r, where
C and r are given. Throughout the following discussion it is assumed that C
has full row rank and hence there is no redundancy in the hypotheses contained
inC.
Assume the hypothesis is that a subset of the ( coefficients are equal to
zero, and that the number of rows of C (i.e. the number of parameters being,
restricted to zero) is q. Further, let the number of parameters in the unrestricted4.15. Hypothesis testing 37
model be p. Then the number of unknown parameters in the restricted model
is p — q. To facilitate the discussion, write f as the unrestricted MLE of 3,
and let denote the MLE of when is maximized subject to the restrictions
CA = 0. For the restricted model the X’ matrix has the columns corresponding
to the restricted parameters deleted, and is denoted as X*
‘The residual sums of squares for the unrestricted and restricted models are
(y — XB)'(y — XA) and (y — X*A)'(y — XA), respectively. The difference
(u— X*B)'(y — X°B) — (y— XB (y - XB) = A'X'y - BX"'y (4.18)
is a measure of the decrease in model fit due to the imposition of the restric-
tions. It is positive (as the residual sum of squares for the unrestricted model
‘must be less than that for the restricted model) and if itis large then one would
conclude that the deterioration in model fit as a result of the restrictions is too
great. In that case the unrestricted model is chosen, i.e. the conclusion is made
that CB 4 0. The commonly used F test uses as test statistic the difference
(4.18), scaled by the estimate of the variance of the unrestricted model:
GX'y—BX"W)/a any
where 6? = (y— X8)'(y—X8)/(n—p). This test statistic, under the assump-
tions summarized in (4.12), has the Fy,n—p distribution, if the restricted model
is correct. One rejects the restricted model if it is “too large,” i.e. in the upper
tail of the Fy,n—p distribution.
Testing a single coefficient. When the hypothesis is that a single coefficient
is zero, ie. 3; = 0, then (4.19) reduces to
B
ob;
where j is diagonal element j of (X’X)~1. From (4.14), the denominater of
(4.20) is the estimated variance of §;. The signed square root of (4.20) is the
well-known “t statistic”, which is J; divided by its estimated standard error:
~Fin-ps (4.20)
Bee tics. 421)
o
Testing the effect of a categorical variable. A test for the significance of a
categorical explanatory variable with r levels involves the hypothesis that the
coefficients of all r — 1 indicator variables are zero. For example, consider
a model with a continuous explanatory variable «ry and a categorical explana-
tory variable with three levels, and corresponding indicator variables ar and58 Linear modeling
2. In this case the hypothesis concerning the significance of the categorical
variable is
Bo
oo10 Br
oe G 00 t) Ba
Bs
ie. Bz = fy = 0.
Sometimes the F test for the significance of a categorical explanatory
variable is rejected, but tests for the coefficients of the individual indicator
variables are not all rejected. This may signal the need for judicious grouping,
of levels, particularly levels which are sparse. Care needs to be taken in this
exercise, as wholesale grouping of, for example, all non-significant levels, may
not make any sense. It is important not to combine category levels which are
dissimilar in nature and do not form a sensible group.
Statistical versus practical significance. Classical hypothesis testing was
developed in an era when data sets were small, typically of the order of tens or
hundreds of observations. Insurance data sets are usually orders of magnitude
larger than this. The effect of increasing sample size is to increase the preci-
sion of parameter estimates. Consider, for simplicity, a test of the hypothesis
A; = 0. Anestimate J; which is close to zero, based on a small data set, may
lead to non-rejection of the hypothesis since its standard error is large, result-
ing in a small value for the t statistic (4,21). However, the identical A; based
on a very large data set will have a small standard error. This results in a large
t statistic and rejection of the hypothesis. However, one has to think about
the magnitude of the effect, and whether the statistical significance translates
into a practically useful effect or relativity. When the effect of an explana-
tory variable is statistically significant but small relative to the effects of other
explanatory variables, it is acceptable to exclude it from a final model. In cases
such as these, model selection criteria (Section 4.19) lead to the exclusion of
cally significant explanatory variables that have little explanatory power.
4.16 Checks using the residuals
A fitted model must be checked. These checks are aimed at confirming whether
the assumptions underlying the fitted model are applicable. The distributional
assumptions of model (4.12) are:
(i) The mean of y varies linearly with the 2’s.
(ii) The error terms € are normally distributed,4.16 Checks using the residuals 59
(iii) The variance of the y's — equivalently the variance of the e's does not
vary with the 2's, i.c. is constant. (Equivalent terms are homoskedas-
ticity, constant variance, homogeneity of variance.)
(iv) The e's are independent.
‘These assumptions must be checked. Note there is no assumption of normality
of the explanatory variables z:;.
‘The assumptions on ¢ are not directly verifiable, since ¢ is not observable.
However the ¢; can be estimated:
é
Yi — (Bo + Brin +--+ + Byarip) = 4s —
These are called the residuals.
nee y = XB +e,
B= (XIX) X'y = (XX) X(XB +6) = B+ (X'X) Xe,
it follows that
XB+e-XB = {I-X(X'X)1X'fe
The matrix H = X(X'X)~1X is called the “hat” matrix because it puts a hat
Hy. if M = 1-H then
M and hence
= Me. Itis easy to verify MM = M
Var(é) = Var(Me) = 07M = 0%(I— H).
Thus Var(é;) = 02(1 — hy) where hi is diagonal element i of H.
Much of model checking is based on the residuals, é, or alternatively the
studentized residuals, defined as
&
“WE: (4.22)
Checking for normality. Normality is checked by examining the distribution
of either the residuals é; or the studentized residuals r;. The best way is via the
pp-plot discussed in Section 1.6, where the percentile ranks of the é or ry are
compared to those of the normal,
Checking for constant variance. If the variance of e, or y, does not vary with
the explanatory variables, then a plot of é or ri against each a, is a random
scatter. The residuals are also commonly plotted against the fitted values 9,
again yielding a random scatter if the constant variance assumption is true.
Non-random scatters thus suggest heteroskedasticity.60 Linear modeling
Checking for independence. If Var(e) = 71, then Var(é) = 07M. Off-
diagonal elements of M are ofien relatively small and hence the é& are
generally approximately independent. While there exist formal tests for cor-
relation, typically one checks for serial correlation (i.e. correlation between
suecessive observations) by plotting the é;’s in an order wherein one suspects
lack of independence, for example the order of occurrence in the sample. If
there is no serial correlation then one would expect to see no pattern in this plot.
4.17 Checking explanatory variable specifications
Model diagnostics also provide guidance for identifying the correct specifica-
tion of explanatory variables in the model. Two plots are useful and extend to
the GLM: added-variable plots and partial residual plots.
Added-variable plots. Added-variable plots are useful for detecting whether
a continuous explanatory variable ; should be in the model, and for identi-
fying the possible cause of unduly large residuals. In this plot the effect of
3 on the regression equation is isolated, given that all the other explanatory
variables are in the model.
An added-variable plot for «j, is a plot of y against ; when both variables
are adjusted for all the other explanatory variables. Adjusting for all other
variables means performing a regression of y and «; on all the other variables,
and computing the residuals. This is done for y and 2; as the responses in
two regressions. The residuals from the two regressions are plotted against
cach other. The least squares slope associated with this plot is the regression
coefficient on 2; when regressing y on all the «variables including i.
A random scatter, i.e. a point cloud with zero slope, indicates that 7; should
not be in the model.
An linear plot means that x; should be included in the model, i.e. the rela-
tionship between y and ; is linear, given the other explanatory variables.
© Curvature in the plot indicates that a transformation is needed for 2.
Partial residual plots. A nonlinear relationship between y and 2; is more
easily detected with a partial residual plot. The partial residuals for «, are
defined as
(ui — G8) + 258; 5
where jj and (; are based on the model including all explanatory variables
(including 3). Thus it is the residual with the explanation afforded by 23
added back in,4.18 Outliers 61
The partial residuals are plotted against 3: the plot will have slope fj, and
a curvature indicates a departure from linearity in the relationship between y
and 2p/n indicates the case is unusual in the space of explanatory
variables, or equivalently is contributing disproportionately to its own fitted
value. Leverages provide a useful mechanism for diagnosing subtle data errors
undetectable using simple checks on sirigle explanatory variables.
4.19 Model selection
Every explanatory variable added to a model improves fit. However adding
unwarranted variables decreases the precision of parameter estimates. While
an explanatory variable may be statistically significant, adding it to the model
may not be worthwhile, because the improvement in fit may be outweighed by
loss of estimation precision. The central concept is the bias-variance tradeoff.
Bias refers to the lack of fit. Variance in this context means the variance of the
regression estimates.
Increasing the number of explanatory variables increases the number of
parameters p and decreases the errors 1; — §j of the fit. A large p leads to low
bias. However, the more parameters in the model, the greater the variances of
the 3;. The aim is to find a model compromising between:
© a large number of parameters and consequently a close fit to the observa-
tions. In this case parameter estimates 3; have low precision (high standard
deviation); and
¢ a small number of parameters with a less good fit. In this case parameter
estimates 3; have relatively high precision (low standard deviation).
There are a number of criteria which balance the goodness of fit of a model
with a penalty term for the number of parameters. The best known are Akaike’s
Information Criterion (AIC) and the Bayesian Information Criterion (BIC):
AIC = —2 + 2p, BIC = —-2£+plnn. (4.23)
Here é is the log-likelihood of the model given in (4.15). A good fit means a
high value for the likelihood, and therefore a low value for —2¢.4.19 Model selection 63
The first two terms in the expres
yielding
‘ion for € in (4.15) are usually omitted,
s
AIC +2p, BIC= 4 +pinn, (4.24)
a
where $ is the sum of squared residuals. The S/a? term is the bias term quan-
tifying the fit of the model to the observations. A good fit yields a low value
for S. The second term in cach of the criteria is the variance term, penalizing
for the number of parameters in the model. A model with a large number of
parameters and a good fit has a low value for the bias term, but the criterion
is pushed up by the variance term. Conversely a model with small p has a
higher bias term but lower variance term, Other things equal, the model with
the lowest value of AIC or BIC is selected,
A decision has to be made whether to use AIC of BIC. The latter applies a
greater penalty for the number of parameters, so tends to choose models with
fewer explanatory variables compared to AIC. When nis large, as is the case
in most insurance data sets, the BIC tends to selects model which most analysts
consider too simple. In this case the AIC is preferable.
Models compared using AIC or BIC must be based on the same set of obser-
vations. ‘This impacts when deciding between models which include at least
one explanatory variable with missing values. Standard software omits from
analysis any cases which have missing values on any of the variables in a
model. This means that if one or other model includes a variable with miss-
ing values, then the models being compared will be based on different sets
of observations, rendering the comparison invalid. The solution is to perform
model selection on the subset of cases which have no missing values for any
of the potential explanatory variables
Stepwise regression. Stepwise regression is an automated form of model
selection. Stepwise algorithms are available in most statistical software. The
methodology has fallen out of favor in recent years, as it is ad hoc, and yields
different results when implemented in different ways. It is often used to avoid
careful thought about the model. It encourages the notion that model selection
can be performed automatically.
‘Model selection is as much art as science. Understanding of the subject mat-
ter, and the interplay between all of the variables, is critical. Judgements about
the inclusion or exclusion of a variable is validly made using information other
than statistical criteria, For example, the expense of measuring or recording a
variable, or the political sensitivity of a variable, may override purely statistical
considerations,