*! version 1.1.0 16mar2014
help vselect

Title

vselect -- Linear regression variable selection

Syntax

All subsets variable selection

vselect depvar indepvars [if] [in] [weight], best [fix(varlist_f) nmodels(#)]

Foward selection

vselect depvar indepvars [if] [in] [weight], forward info_crit [fix(varlist_f)]

Backward elimination

vselect depvar indepvars [if] [in] [weight], backward info_crit [fix(varlist_f)]

info_crit

r2adj use R^2 adjusted information criterion

aic use Akaike's information criterion

aicc use Akaike's corrected information criterion

bic use Bayesian information criterion

aweights, fweights, and pweights
are allowed; see weight.

varlist_f may
contain factor variables; see fvvarlist.

Description

vselect performs variable selection for linear regression. Through the
use of the Furnival-Wilson leaps-and-bounds algorithm, all-subsets variable
selection is supported. This is performed when the user specifies the
best option. The stepwise methods, forward selection and backward
elimination, are also supported. These methods are performed when
forward or backward are specified.

All-subsets variable selection provides the R^2 adjusted, Mallows's C,
Akaike's information criterion, Akaike's corrected information criterion, and
Bayesian information criterion for the best regression at each quantity of
predictors. For stepwise selection, the user must tell vselect which
information criterion to use.

Options

fix(varlist) specifies predictors that are to be used
in every regression. Factor variables are allowed in fix().

nmodels(#) Report the best # models for each quantity of predictors.

best gives the best model for each quantity of predictors.

backward selects a model by backward elimination.

forward selects a model by forward selection.

r2adj uses R^2 adjusted information criterion in stepwise
selection.

aic uses Akaike's information criterion in stepwise selection.

aicc uses Akaike's corrected information criterion in stepwise
selection.

bic uses Bayesian information criterion in stepwise selection.

Examples

. sysuse auto

. regress mpg weight trunk length foreign

. estat ic

. vselect mpg weight trunk length foreign, best

. regress mpg weight foreign length

. estat ic

. vselect mpg weight trunk length, fix(i.foreign) best nmodels(2)

. regress mpg i.foreign `r(best22)'

. estat ic

. vselect mpg weight trunk length foreign, forward aicc

. vselect mpg weight trunk length foreign, backward bic

. estat ic

. webuse census13

. generate ne = region == 1

. generate n = region == 2

. generate s = region == 3

. generate w = region == 4

. summarize medage

. generate tmedage = (medage-r(mean))/r(sd)

. generate tmedage2 = tmedage^2

. vselect brate tmedage tmedage2 dvcrate n s w [aweight=pop], best fix(mrgrate)

. regress brate mrgrate `r(best5)' [aweight=pop]

. estat ic

Saved results

When nmodels() < 2, vselect, best saves the following in r():

Macros

r(bestk) variable list of predictors from best k predictor model

.

.

.

r(best1) variable list of predictors from best 1 predictor model

Matrices

r(info) contains the information criteria for the best models

When m = nmodels() > 1, vselect, best saves the following in r():

Macros

r(bestk1) variable list of predictors from best k predictor model

.

.

.

r(best11) variable list of predictors from best 1 predictor model

.

.

.

r(bestkm) variable list of predictors from mth best k predictor model

.

.

.

r(best1m) variable list of predictors from mth best 1 predictor model

Matrices

r(info) contains the information criteria for the best models

vselect, forward and vselect, backward save the following in r():

Macros

r(predlist) variable list of predictors from the optimal model

Authors

Charles Lindsey

StataCorp

College Station, TX

clindsey@stata.com

Simon Sheather

Department of Statistics

Texas A&M University

College Station, TX