The routine may be called by the names g02faf or nagf_correg_linregm_stat_resinf.
3Description
For the general linear regression model
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 parameters,
and
is a vector of length of unknown random errors such that .
The residuals are given by
and the fitted values, , can be written as for an by matrix . The th diagonal elements of , , give a measure of the influence of the th values of the independent variables on the fitted regression model. The values of and the are returned by g02daf.
g02faf 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:
(i)The th residual is standardized by its variance when the estimate of , , is calculated from all the data; this is known as internal Studentization.
(ii)The th residual is standardized by its variance when the estimate of , is calculated from the data excluding the th observation; this is known as external Studentization.
The two measures of influence are:
(i)Cook's
(ii)Atkinson's
4References
Atkinson A C (1981) Two graphical displays for outlying and influential observations in regression Biometrika68 13–20
Cook R D and Weisberg S (1982) Residuals and Influence in Regression Chapman and Hall
5Arguments
1: – IntegerInput
On entry: , the number of observations included in the regression.
Constraint:
.
2: – IntegerInput
On entry: , the number of linear parameters estimated in the regression model.
Constraint:
.
3: – IntegerInput
On entry: the number of residuals.
Constraint:
.
4: – Real (Kind=nag_wp) arrayInput
On entry: the residuals, .
5: – Real (Kind=nag_wp) arrayInput
On entry: the diagonal elements of , , corresponding to the residuals in res.
Constraint:
, for .
6: – Real (Kind=nag_wp)Input
On entry: the estimate of based on all observations, , i.e., the residual mean square.
Constraint:
.
7: – Real (Kind=nag_wp) arrayOutput
On exit: the standardized residuals and influence statistics.
For the observation with residual, , given in .
Is the internally standardized residual, .
Is the externally standardized residual, .
Is Cook's statistic, .
Is Atkinson's statistic, .
8: – IntegerInput
On entry: the first dimension of the array sres as declared in the (sub)program from which g02faf is called.
Constraint:
.
9: – IntegerInput/Output
On entry: ifail must be set to , . If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this argument, the recommended value is . When the value is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: , for all .
On entry, a value in res is too large for given rms. and .
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
Accuracy is sufficient for all practical purposes.
8Parallelism and Performance
g02faf is not threaded in any implementation.
9Further Comments
None.
10Example
A set of residuals and values from a parameter 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 observations.