全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8059 5
2011-05-03
哪本书有介绍?多谢
二维码

扫码加我 拉你入群

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

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

全部回复
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).
二维码

扫码加我 拉你入群

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

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

2011-5-3 18:57:59
蓝色大侠还是真牛啊,不服不行。
二维码

扫码加我 拉你入群

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

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

2011-5-4 00:03:29
这还牛,看看
二维码

扫码加我 拉你入群

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

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

2011-5-4 21:01:42
多谢。。。
二维码

扫码加我 拉你入群

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

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

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

扫码加我 拉你入群

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

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

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

说点什么

分享

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