nag_regsn_std_resid_influence (g02fac) calculates two types of standardized residuals and two measures of influence for a linear regression.
For the general linear regression model is defined by
where |
|
is a vector of length of the dependent variable, |
|
|
is an by matrix of the independent variables, |
|
|
is a vector of length of unknown arguments, |
and |
|
is a vector of length of unknown random errors such that . |
The residuals are given by
The fitted values,
, can be written as
for an
by
matrix
. The
th diagonal element of
,
, gives a measure of the influence of the
th value of the independent variables on the fitted regression model. The values of
and the
are returned by
nag_regsn_mult_linear (g02dac).
nag_regsn_std_resid_influence (g02fac) calculates statistics which help to indicate if an observation is extreme and having an undue influence on the fit of the regression model. Two types of standardized residual are calculated:
(a) |
The th residual is standardized by its variance when the estimate of , , is calculated from all the data; known as internal studentization.
|
(b) |
The th residual is standardized by its variance when the estimate of , is calculated from the data excluding the th observation; known as external studentization.
|
The two measures of influence are:
(a) |
Cook's
|
(b) |
Atkinson's
|
Atkinson A C (1981) Two graphical displays for outlying and influential observations in regression Biometrika 68 13–20
- 1:
– IntegerInput
-
On entry: number of observations included in the regression, .
Constraint:
.
- 2:
– IntegerInput
-
On entry: the number of linear arguments estimated in the regression model, .
Constraint:
.
- 3:
– IntegerInput
-
On entry: the number of residuals.
Constraint:
.
- 4:
– const doubleInput
-
On entry: the residuals, .
- 5:
– const doubleInput
-
On entry: the diagonal elements of
,
, corresponding to the residuals in
res.
Constraint:
, for .
- 6:
– doubleInput
-
On entry: the estimate of based on all observations, , i.e., the residual mean square.
Constraint:
.
- 7:
– doubleOutput
-
On exit: the standardized residuals and influence statistics.
For the observation with residual given in
:
- is the internally studentized residual
- is the externally studentized residual
- is Cook's statistic
- is Atkinson's statistic.
- 8:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
Accuracy is sufficient for all practical purposes.
Not applicable.
None.
A set of 24 residuals and
values from an 11 argument model fitted to the cloud seeding data considered in
Cook and Weisberg (1982) are input and the standardized residuals etc calculated and printed for the first 10 observations.