nag_regsn_mult_linear_delete_var (g02dfc) deletes an independent variable from a general linear regression model.
When selecting a linear regression model it is sometimes useful to drop independent variables from the model and to examine the resulting sub-model. nag_regsn_mult_linear_delete_var (g02dfc) updates the
decomposition used in the computation of the linear regression model. The
decomposition may come from
nag_regsn_mult_linear (g02dac),
nag_regsn_mult_linear_addrem_obs (g02dcc),
nag_regsn_mult_linear_add_var (g02dec) or a previous call to nag_regsn_mult_linear_delete_var (g02dfc).
For the general linear regression model with
independent variables fitted,
nag_regsn_mult_linear (g02dac) or
nag_regsn_mult_linear_add_var (g02dec) computes a
decomposition of the (weighted) independent variables and forms an upper triangular matrix
and a vector
. To remove an independent variable
and
have to be updated. The column of
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
. Note that only the first
elements of
are affected.
The method used means that while the updated values of
and
are computed an updated value of
from the
decomposition is not available so a call to
nag_regsn_mult_linear_add_var (g02dec) cannot be made after a call to nag_regsn_mult_linear_delete_var (g02dfc).
nag_regsn_mult_linear_upd_model (g02ddc) can be used to calculate the parameter estimates,
, from the information provided by nag_regsn_mult_linear_delete_var (g02dfc).
Hammarling S (1985) The singular value decomposition in multivariate statistics SIGNUM Newsl. 20(3) 2–25
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
nag_regsn_mult_linear (g02dac).
Not applicable.
None.
A dataset consisting of 12 observations on four independent variables and one dependent variable is read in. The full model, including a mean term, is fitted using
nag_regsn_mult_linear (g02dac). The value of
indx is read in and that variable dropped from the regression. The parameter estimates are calculated by
nag_regsn_mult_linear_upd_model (g02ddc) and printed. This process is repeated until
indx is 0.