全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
4895 1
2013-07-30
该命令用于线性模型的变量筛选,命令很强大!
需要自行安装。
具体介绍见下
vselect -- Linear regression variable selection

Syntax
        vselect depvar indepvars [if] [in] [weight] [, fix(varlist) best backward forward r2adj aic aicc bic]
        fweights, aweights, and pweights are allowed; see weight.

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 done when the user specifies the best option.  The stepwise methods, forward
    selection and backward elimination, are also supported (by specifying forward or backward).
    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.
    The user may also specify a fixed predictor list in fix() that will be included in every model.

Options
    fix(varlist) fixes these predictors in every regression.
    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(foreign) best
    . regress mpg foreign `r(best2)'
    . 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
    vselect saves the following in r():
    Macros              
      r(bestK)       variable list of predictors from best K predictor model
      r(besti)       variable list of predictors from best i predictor model
      r(best1)       variable list of predictors from best 1 predictor model
      r(predlist)    variable list of predictors from the optimal model
    Matrices            
      r(info)        contains the information criteria for the best models

Authors
    Charles Lindsey
    StataCorp
    College Station, TX
    clindsey@stata.com
    Simon Sheather
    Department of Statistics
    Texas A&M University
    College Station, TX

Also see
    Article:  Stata Journal, volume 11, number 1: st0213_1,
              Stata Journal, volume 10, number 4: st0213

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-7-30 17:28:45
自己先顶了。。。。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群