楼主: tomfreeman
8096 5

[其他] stata怎样做step wise [推广有奖]

  • 3关注
  • 6粉丝

已卖:113份资源

教授

73%

还不是VIP/贵宾

-

威望
0
论坛币
1448 个
通用积分
0.0012
学术水平
14 点
热心指数
19 点
信用等级
8 点
经验
1028 点
帖子
995
精华
0
在线时间
1131 小时
注册时间
2008-12-1
最后登录
2021-9-29

楼主
tomfreeman 发表于 2011-5-3 15:58:21 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
哪本书有介绍?多谢
二维码

扫码加我 拉你入群

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

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

关键词:Stata Step tata WISE

沙发
蓝色 发表于 2011-5-3 18:17:54
能不能先把手册的命令大致看一下啊



Title

    [R] stepwise -- Stepwise estimation


Syntax

        stepwise [, options ] : command

    options           description
    -----------------------------------------------------------------------------------------------------------
    Model
    * pr(#)           significance level for removal from the model
    * pe(#)           significance level for addition to the model

    Model2
      forward         perform forward-stepwise selection
      hierarchical    perform hierarchical selection
      lockterm1       keep the first term
      lr              perform likelihood ratio-test instead of Wald test
    -----------------------------------------------------------------------------------------------------------
    * At least one of pr(#) or pe(#) must be specified.
    by and xi are allowed; see prefix.
    Weights are allowed if command allows them; see weight.
    All postestimation commands behave as they would after command without the stepwise prefix; see the
      postestimation manual entry for command.


Menu

    Statistics > Other > Stepwise estimation


Description

    stepwise performs stepwise estimation.  Typing

        . stepwise, pr(#): command

    performs backward-selection estimation for command.  The stepwise selection method is determined by the
    following option combinations:

    options                   description
    -----------------------------------------------------------------------------------------------------------
    pr(#)                     backward selection
    pr(#) hierarchical        backward hierarchical selection
    pr(#) pe(#)               backward stepwise

    pe(#)                     forward selection
    pe(#) hierarchical        forward hierarchical selection
    pr(#) pe(#) forward       forward stepwise
    -----------------------------------------------------------------------------------------------------------

    command defines the estimation command to be executed.  The following Stata commands are supported by
    stepwise.

        clogit, cloglog, glm, intreg, logistic, logit, nbreg, ologit, oprobit, poisson, probit, qreg, regress,
        scobit, stcox, stcrreg, streg, tobit

    stepwise expects command to have the following form:

        command_name [depvar] term [term ...] [if] [in] [weight] [, command_options]

    where term is either varname or (varlist) (a varlist in parentheses indicates that this group of variables
    is to be included or excluded together).  depvar is not present when command_name is streg, stcox, or
    stcrreg; otherwise, depvar is assumed to be present.  For intreg, depvar is actually two dependent variable
    names (depvar1 and depvar2).

    sw is a synonym for stepwise.


Options

        +-------+
    ----+ Model +----------------------------------------------------------------------------------------------

    pr(#) specifies the significance level for removal from the model; terms with p>=pr() are eligible for
        removal.

    pe(#) specifies the significance level for addition to the model; terms with p<pe() are eligible for
        addition.

        +--------+
    ----+ Model2 +---------------------------------------------------------------------------------------------

    forward specifies the forward-stepwise method and may be specified only when both pr() and pe() are also
        specified.  Specifying both pr() and pe() without forward results in backward-stepwise selection.
        Specifying only pr() results in backward selection, and specifying only pe() results in forward
        selection.

    hierarchical specifies hierarchical selection.

    lockterm1 specifies that the first term be included in the model and not be subjected to the selection
        criteria.

    lr specifies the test of term significance be the likelihood-ratio test.  The default is the less
        computationally expensive Wald test; that is, the test is based on the estimated variance-covariance
        matrix of the estimators.


Examples

    Setup
        . sysuse auto
        . generate weight2 = weight^2

    Backward selection
        . stepwise, pr(.2): regress mpg weight weight2 displ gear turn headroom foreign price

    Backward selection; consider engine displacement and gear ratio together
        . stepwise, pr(.2): regress mpg weight weight2 (displ gear) turn headroom foreign price

    Backward selection; force weight to be included in model
        . stepwise, pr(.2) lockterm1: regress mpg weight weight2 displ gear turn headroom foreign price

    Backward selection; force weight and weight2 to be included in model
        . stepwise, pr(.2) lockterm1: regress mpg (weight weight2) displ gear turn headroom foreign price

    Backward hierarchical selection
        . stepwise, pr(.2) hierarchical: regress mpg weight weight2 displ gear turn headroom foreign

    Forward selection
        . stepwise, pe(.2): regress mpg weight weight2 displ gear turn headroom foreign price

    Forward hierarchical selection
        . stepwise, pe(.2) hierarchical: regress mpg weight weight2 displ gear turn headroom foreign price


Programming for stepwise

    stepwise requires that command_name follow standard Stata syntax and allow the if qualifier.  Furthermore,
    command_name must have sw or swml as a program property; see [P] program properties.  If command_name has
    swml as a property, command_name must save the log-likelihood value in e(ll) and model degrees of freedom
    in e(df_m).


Saved results

    stepwise saves whatever is saved by the underlying estimation command.

    Also, stepwise saves stepwise in e(stepwise).

藤椅
chyshl 发表于 2011-5-3 18:57:59
蓝色大侠还是真牛啊,不服不行。

板凳
caoqiang06 发表于 2011-5-4 00:03:29
这还牛,看看
多做学术

报纸
tomfreeman 发表于 2011-5-4 21:01:42
多谢。。。
forever young

地板
luzhaoy 发表于 2013-12-16 16:12:18
蓝色大侠直接copy了vier里面的介绍……,你还说他牛?他应该讲解一下自己做stepwise的经验才好……

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-9 03:29