Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

 Quantlet: linregbs Description: linregbs computes a backward elimination of a multiple linear regression model.

Reference(s):
Neter, J., Wasserman, W. and Kutner, M. H. (1989), Applied linear regression models, p. 452-460 Kotz, S., Johnson, N. L. and Read, C. B. (1989), Encyclopedia of Statistical Science, Vol.8, p. 766-767

 Usage: {b,bse,bstan,bpval} = linregbs (x, y, colname{, opt}) Input: x n x p x d1 x ... x dn array y n x 1 x d1 x ... x dn array colname string vector opt scalar Output: b p x 1 x d1 x ... x dn array bse p x 1 x d1 x ... x dn array bstan p x 1 x d1 x ... x dn array bpval p x 1 x d1 x ... x dn array

Note:
It is the opposite of forward selection. The regressors x do not contain an intercept column. The optional parameter opt can be set using linregopt. Otherwise the probability of F-to-remove will be set 0.10. The procedure begins with the model containing all potential x variables and identifies the one with the smallest partial F value. If the minimum F is less then F-to-remove, that variables is dropped. The model with the remaining variables then fitted, and the next candidate for dropping identified. The procedure continues until no further independent variables can be dropped. If all x variables are dropped the estimate contains only the intercept.

Example:
```library("stats")
setenv("outputstringformat", "%s")
x1 = #(7,1,11,11,7,11,3,1,2,21,1,11,10)
x2 = #(26,29,56,31,52,55,71,31,54,47,40,66,68)
x3 = #(6,15,8,8,6,9,17,22,18,4,23,9,8)
x4 = #(60,52,20,47,33,22,6,44,22,26,34,12,12)
x  = x1~x2~x3~x4
y  = #(78.5,74.3,104.3,87.6,95.9,109.2,102.7,72.5)
y  = y|#(93.1,115.9,83.8,113.3,109.4)
colname=string("X %.f",1:cols(x))
opt = linregopt("Fout", 3.9)
{beta,se,betastan,p} = linregbs(x,y,colname,opt)

```
Result:
```Contents of string
[1,] Out : X 3
Contents of string
[1,] Out : X 4

Contents of Removal
[ 1,] Backward Elimination
[ 2,] -------------------------------
[ 3,] F-to-remove 3.90
[ 4,] probability of F-to-remove 0.94
[ 5,]
[ 6,] Step  Multiple R      R^2        F        SigF        Variable(s)
[ 7,]  1     0.9911       0.9824    111.479    0.000    Out:       none
[ 8,]  2     0.9911       0.9823    166.823    0.000    Out: X 3
[ 9,]  3     0.9893       0.9787    229.504    0.000    Out: X 4
[10,]
[11,] Variable removed at Step Number  3 = X 4

Contents of ANOVA
[ 1,]
[ 2,] A  N  O  V  A                   SS      df     MSS       F-test   P-value
[ 3,] _________________________________________________________________________
[ 4,] Regression                  2657.859     2  1328.929     229.504   0.0000
[ 5,] Residuals                     57.904 1e+01     5.790
[ 6,] Total Variation                 2716    12   226.314
[ 7,]
[ 8,] Multiple R      = 0.98928
[ 9,] R^2             = 0.97868
[11,] Standard Error  = 2.40634

Contents of Summary
[1,] Variables in the Equation for Y:
[2,]
[3,]
[4,] PARAMETERS         Beta         SE         StandB      t-test   P-value  Variable
[5,]   __________________________________________________________________________________
[6,] b[ 0,]=         52.5773       2.2862       0.0000     22.9980   0.0000   Constant
[7,] b[ 1,]=          1.4683       0.1213       0.5741     12.1047   0.0000   X 1
[8,] b[ 2,]=          0.6623       0.0459       0.6850     14.4424   0.0000   X 2
```

Author: K. Zanter, W. Haerdle, 19980331 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006