g02fa calculates two types of standardized residuals and two measures of influence for a linear regression.
Syntax
C# |
---|
public static void g02fa( int n, int ip, int nres, double[] res, double[] h, double rms, double[,] sres, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02fa ( _ n As Integer, _ ip As Integer, _ nres As Integer, _ res As Double(), _ h As Double(), _ rms As Double, _ sres As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02fa( int n, int ip, int nres, array<double>^ res, array<double>^ h, double rms, array<double,2>^ sres, [OutAttribute] int% ifail ) |
F# |
---|
static member g02fa : n : int * ip : int * nres : int * res : float[] * h : float[] * rms : float * sres : float[,] * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: , the number of observations included in the regression.Constraint: .
- ip
- Type: System..::..Int32On entry: , the number of linear parameters estimated in the regression model.Constraint: .
- nres
- Type: System..::..Int32On entry: the number of residuals.Constraint: .
- res
- Type: array<System..::..Double>[]()[][]An array of size [nres]On entry: the residuals, .
- h
- Type: array<System..::..Double>[]()[][]An array of size [nres]On entry: the diagonal elements of , , corresponding to the residuals in res.Constraint: , for .
- rms
- Type: System..::..DoubleOn entry: the estimate of based on all observations, , i.e., the residual mean square.Constraint: .
- sres
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, ]Note: dim1 must satisfy the constraint: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, .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
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 g02da.
g02fa 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
|
References
Atkinson A C (1981) Two graphical displays for outlying and influential observations in regression Biometrika 68 13–20
Cook R D and Weisberg S (1982) Residuals and Influence in Regression Chapman and Hall
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDSRES) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or , or , or .
On entry, or , for some .
On entry, the value of a residual is too large for the given value of rms.
Accuracy
Accuracy is sufficient for all practical purposes.
Parallelism and Performance
None.
Further Comments
None.
Example
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.
Example program (C#): g02fae.cs