楼主: offandon
1742 1

[Stata] -vselect-线性模型的变量筛选 [推广有奖]

  • 4关注
  • 21粉丝

已卖:3242份资源

学科带头人

26%

还不是VIP/贵宾

-

威望
0
论坛币
46180 个
通用积分
90.9439
学术水平
52 点
热心指数
74 点
信用等级
53 点
经验
108375 点
帖子
2122
精华
0
在线时间
2047 小时
注册时间
2008-6-17
最后登录
2024-2-9

楼主
offandon 发表于 2015-2-15 21:50:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
该命令用于线性模型的变量筛选,命令很强大!
需要自行安装。
具体介绍见下
vselect -- Linear regression variable selection



Description + Options + Examples  +AuthorsSaved+ results








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



   
  1. . sysuse auto
  2.     . regress mpg weight trunk length foreign
  3.     . estat ic
  4.     . vselect mpg weight trunk length foreign, best
  5.     . regress mpg weight foreign length
  6.     . estat ic
  7.     . vselect mpg weight trunk length, fix(foreign) best
  8.     . regress mpg foreign `r(best2)'
  9.     . estat ic
  10.     . vselect mpg weight trunk length foreign, forward aicc
  11.     . vselect mpg weight trunk length foreign, backward bic
  12.     . estat ic
  13.     . webuse census13
  14.     . generate ne = region == 1
  15.     . generate n = region == 2
  16.     . generate s = region == 3
  17.     . generate w = region == 4
  18.     . summarize medage
  19.     . generate tmedage = (medage-r(mean))/r(sd)
  20.     . generate tmedage2 = tmedage^2
  21.     . vselect brate tmedage tmedage2 dvcrate n s w [aweight=pop], best fix(mrgrate)
  22.     . regress brate mrgrate `r(best5)' [aweight=pop]
  23.     . 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


二维码

扫码加我 拉你入群

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

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

关键词:vselect Select Elect 线性模型 变量筛选 vselect stata 线性模型 变量筛选

已有 2 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
niuniuyiwan + 60 + 60 + 5 + 5 + 5 对论坛有贡献
np84 + 40 对论坛有贡献

总评分: 经验 + 100  论坛币 + 60  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

本帖被以下文库推荐

沙发
niuniuyiwan 在职认证  发表于 2015-8-1 06:35:54
好帖,谢谢分享

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 23:04