[R] Selecting Best Regression Equation

Thomas Lumley tlumley at u.washington.edu
Mon Apr 5 16:46:06 CEST 2004

On Mon, 5 Apr 2004, WilDscOp wrote:

> Dear all,
> 	Does R or S-plus or any of their packages provide any command to form any
> of the following procedures to find Best Regression Equation -
> 	1. 'All Possible Regressions Procedures' (is there any automated command
> to perform 2^p regressions and ordering according to criteria R2(adj),
> mallows Cp, s2- by not setting all the regression models manually),
> 	2. 'Backward Elimination Procedure' ,
> 	3. 'Forward Selection Procedure' ,
> 	4. 'Stepwise Regression Procedure' (as SAS's PROC REG /METHOD = STEPWISE /
> FORWARD / BACKWARD which methods are also available in SPSS) or
> 	5. 'Best subset selection (as MINITAB's BREG - BEST k command)'.

4 is available in step() and the MASS package's stepAIC().

2,3,5 are in the leaps package (as is 1 if you really want it, by setting
the number of models large enough).

It's a lot easier to find the functions than to find good reasons for
wanting them.


More information about the R-help mailing list