g02df deletes an independent variable from a general linear regression model.


public static void g02df(
	int ip,
	double[,] q,
	int indx,
	ref double rss,
	out int ifail
Visual Basic
Public Shared Sub g02df ( _
	ip As Integer, _
	q As Double(,), _
	indx As Integer, _
	ByRef rss As Double, _
	<OutAttribute> ByRef ifail As Integer _
Visual C++
static void g02df(
	int ip, 
	array<double,2>^ q, 
	int indx, 
	double% rss, 
	[OutAttribute] int% ifail
static member g02df : 
        ip : int * 
        q : float[,] * 
        indx : int * 
        rss : float byref * 
        ifail : int byref -> unit 


Type: System..::..Int32
On entry: p, the number of independent variables already in the model.
Constraint: ip1.
Type: array<System..::..Double,2>[,](,)[,][,]
An array of size [dim1, ip+1]
Note: dim1 must satisfy the constraint: dim1ip
On entry: the results of the QR decomposition as returned by methods g02da g02dc g02de (G02EEF not in this release), or previous calls to g02df.
On exit: the updated QR decomposition.
Type: System..::..Int32
On entry: indicates which independent variable is to be deleted from the model.
Constraint: 1indxip.
Type: System..::..Double%
On entry: the residual sum of squares for the full regression.
Constraint: rss0.0.
On exit: the residual sum of squares with the (indx)th variable removed. Note that the residual sum of squares will only be valid if the regression is of full rank, otherwise the residual sum of squares should be obtained using g02dd.
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).


When selecting a linear regression model it is sometimes useful to drop independent variables from the model and to examine the resulting sub-model. g02df updates the QR decomposition used in the computation of the linear regression model. The QR decomposition may come from g02da or g02de, or a previous call to g02df.
For the general linear regression model with p independent variables fitted g02da or g02de compute a QR decomposition of the (weighted) independent variables and form an upper triangular matrix R and a vector c. To remove an independent variable R and c have to be updated. The column of R corresponding to the variable to be dropped is removed and the matrix is then restored to upper triangular form by applying a series of Givens rotations. The rotations are then applied to c. Note only the first p elements of c are affected.
The method used means that while the updated values of R and c are computed an updated value of Q from the QR decomposition is not available so a call to g02de cannot be made after a call to g02df.
g02dd can be used to calculate the parameter estimates, β^, from the information provided by g02df.


Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Hammarling S (1985) The singular value decomposition in multivariate statistics SIGNUM Newsl. 20(3) 2–25

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDQ) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry,ip<1,
On entry,a diagonal element of R is zero.
An error occured, see message report.
Invalid Parameters value
Invalid dimension for array value
Negative dimension for array value
Invalid Parameters value


There will inevitably be some loss in accuracy in fitting a model by dropping terms from a more complex model rather than fitting it afresh using g02da.

Parallelism and Performance


Further Comments



See Also