全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
16620 16
2014-09-13
如题,求理论支持~
二维码

扫码加我 拉你入群

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

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

全部回复
2014-9-14 14:41:52
哪里是一样的了?
二维码

扫码加我 拉你入群

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

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

2014-9-14 16:52:34
是的呀……
给您看一下我的结果:

ivprobit dum_ent dum_risk1 dum_risk2 dum_edu1 dum_edu2 income income2 distance (ppsize = iv ),vce(robust)

                                               
                Robust
        Coef.        Std. Err.        z        P>z        [95% Conf.        Interval]
                                               
ppsize        -.9790309        .3129658        -3.13        0.002        -1.592433        -.3656292
dum_risk1        .2246889        .0942514        2.38        0.017        .0399594        .4094183
dum_risk2        .1317749        .0684062        1.93        0.054        -.0022989        .2658486
dum_edu1        .2588291        .0541294        4.78        0.000        .1527374        .3649207
dum_edu2        .2441018        .219541        1.11        0.266        -.1861907        .6743943
income        .0380276        .0067138        5.66        0.000        .0248687        .0511865
income2        -.0001232        .0000277        -4.44        0.000        -.0001776        -.0000689
distance        -.0021101        .0006328        -3.33        0.001        -.0033503        -.0008699
_cons        -1.284447        .4224158        -3.04        0.002        -2.112366        -.4565268
                                               

mfx

                                                       
variable       dy/dx        Std. Err.        z        P>z        [    95%        C.I.   ]        X
                                                       
ppsize   -.9790309        .31297        -3.13        0.002        -1.59243        -.365629        .425283
dum_ri~1*   .2246889        .09425        2.38        0.017        .039959        .409418        .39273
dum_ri~2*   .1317749        .06841        1.93        0.054        -.002299        .265849        .129355
dum_edu1*   .2588291        .05413        4.78        0.000        .152737        .364921        .677641
dum_edu2*   .2441018        .21954        1.11        0.266        -.186191        .674394        .157202
income    .0380276        .00671        5.66        0.000        .024869        .051187        4.03334
income2   -.0001232        .00003        -4.44        0.000        -.000178        -.000069        142.592
distance   -.0021101        .00063        -3.33        0.001        -.00335        -.00087        40.4307
                                                       
系数竟然一模一样。。。
二维码

扫码加我 拉你入群

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

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

2014-9-17 08:00:47
你用stata自带的例子试试,不要想当然用命令。mfx 是就版本的命令了。
遇到问题,先看帮助和手册



Title

    [R] ivprobit postestimation -- Postestimation tools for ivprobit


Description

    The following postestimation commands are of special interest after ivprobit:

    Command                 Description
    -----------------------------------------------------------------------------------------------------------------
    estat classification    report various summary statistics, including the classification table
    lroc                    compute area under ROC curve and graph the curve
    lsens                   graph sensitivity and specificity versus probability cutoff
    -----------------------------------------------------------------------------------------------------------------
    These commands are not appropriate after the two-step estimator or the svy prefix.

    The following standard postestimation commands are also available:

    Command                 Description
    -----------------------------------------------------------------------------------------------------------------
        contrast            contrasts and ANOVA-style joint tests of estimates
    (1) estat ic            Akaike's and Schwarz's Bayesian information criteria (AIC and BIC)
        estat summarize     summary statistics for the estimation sample
        estat vce           variance-covariance matrix of the estimators (VCE)
        estat (svy)         postestimation statistics for survey data
        estimates           cataloging estimation results
    (2) forecast            dynamic forecasts and simulations
        hausman             Hausman's specification test
        lincom              point estimates, standard errors, testing, and inference for linear combinations of
                              coefficients
    (3) lrtest              likelihood-ratio test; not available with two-step estimator
        margins             marginal means, predictive margins, marginal effects, and average marginal effects
        marginsplot         graph the results from margins (profile plots, interaction plots, etc.)
        nlcom               point estimates, standard errors, testing, and inference for nonlinear combinations of
                              coefficients
        predict             predictions, residuals, influence statistics, and other diagnostic measures
        predictnl           point estimates, standard errors, testing, and inference for generalized predictions
        pwcompare           pairwise comparisons of estimates
    (1) suest               seemingly unrelated estimation
        test                Wald tests of simple and composite linear hypotheses
        testnl              Wald tests of nonlinear hypotheses
    -----------------------------------------------------------------------------------------------------------------
    (1) estat ic and suest are not appropriate after ivprobit, twostep.
    (2) forecast is not appropriate with svy estimation results or after ivprobit, twostep.
    (3) lrtest is not appropriate with svy estimation results.


Syntax for predict

    After ML or twostep

        predict [type] newvar [if] [in] [, statistic rules asif]


    After ML

        predict [type] {stub*|newvarlist} [if] [in] , scores


    statistic             Description
    -----------------------------------------------------------------------------------------------------------------
    Main
      xb                  linear prediction; the default
      stdp                standard error of the linear prediction
      pr                  probability of a positive outcome; not available with two-step estimator
    -----------------------------------------------------------------------------------------------------------------
    These statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for
      the estimation sample.


Menu for predict

    Statistics > Postestimation > Predictions, residuals, etc.


Options for predict

        +------+
    ----+ Main +-----------------------------------------------------------------------------------------------------

    xb, the default, calculates the linear prediction.

    stdp calculates the standard error of the linear prediction.

    pr calculates the probability of a positive outcome. pr is not available with the two-step estimator.

    rules requests that Stata use any rules that were used to identify the model when making the prediction.  By
        default, Stata calculates missing for excluded observations. rules is not available with the two-step
        estimator.

    asif requests that Stata ignore the rules and the exclusion criteria and calculate predictions for all
        observations possible using the estimated parameters from the model.  asif is not available with the two-step
        estimator.

    scores, not available with twostep, calculates equation-level score variables.

        For models with one endogenous regressor, four new variables are created.

            The first new variable will contain the first derivative of the log likelihood with respect to the probit
            equation.

            The second new variable will contain the first derivative of the log likelihood with respect to the
            reduced-form equation for the endogenous regressor.

            The third new variable will contain the first derivative of the log likelihood with respect to
            atanh(rho).

            The fourth new variable will contain the first derivative of the log likelihood with respect to
            ln(sigma).

        For models with j endogenous regressors, j + {(j + 1)(j + 2)}/2 new variables are created.

            The first new variable will contain the first derivative of the log likelihood with respect to the probit
            equation.

            The second through (j + 1)th new variables will contain the first derivatives of the log likelihood with
            respect to the reduced-form equations for the endogenous variables in the order they were specified when
            ivprobit was called.

            The remaining score variables will contain the partial derivatives of the log likelihood with respect to
            s[2,1], s[3,1], ..., s[j+1,1], s[2,2], ..., s[j+1,2], ..., s[j+1,j+1], where s[m,n] denotes the (m,n)
            element of the Cholesky decomposition of the error covariance matrix.


Examples

    Setup
        . webuse laborsup
        . ivprobit fem_work fem_educ kids (other_inc = male_educ)

    Compute average marginal effect of fem_educ on probability that a woman works
        . margins, dydx(fem_educ) predict(pr)

    Same as above, but specify no children
        . margins, dydx(fem_educ) predict(pr) at(kids=0)









. webuse laborsup

. ivprobit fem_work fem_educ kids (other_inc = male_educ)

Fitting exogenous probit model

Iteration 0:   log likelihood = -344.63508  
Iteration 1:   log likelihood = -255.36855  
Iteration 2:   log likelihood = -255.31444  
Iteration 3:   log likelihood = -255.31444  

Fitting full model

Iteration 0:   log likelihood = -2371.4753  
Iteration 1:   log likelihood = -2369.3178  
Iteration 2:   log likelihood = -2368.2198  
Iteration 3:   log likelihood = -2368.2062  
Iteration 4:   log likelihood = -2368.2062  

Probit model with endogenous regressors           Number of obs   =        500
                                                  Wald chi2(3)    =     163.88
Log likelihood = -2368.2062                       Prob > chi2     =     0.0000

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   other_inc |  -.0542756   .0060854    -8.92   0.000    -.0662027   -.0423485
    fem_educ |    .211111   .0268648     7.86   0.000     .1584569    .2637651
        kids |  -.1820929   .0478267    -3.81   0.000    -.2758316   -.0883543
       _cons |   .3672083   .4480724     0.82   0.412    -.5109975    1.245414
-------------+----------------------------------------------------------------
     /athrho |   .3907858   .1509443     2.59   0.010     .0949403    .6866313
    /lnsigma |   2.813383   .0316228    88.97   0.000     2.751404    2.875363
-------------+----------------------------------------------------------------
         rho |   .3720374   .1300519                      .0946561    .5958135
       sigma |   16.66621   .5270318                      15.66461    17.73186
------------------------------------------------------------------------------
Instrumented:  other_inc
Instruments:   fem_educ kids male_educ
------------------------------------------------------------------------------
Wald test of exogeneity (/athrho = 0): chi2(1) =     6.70 Prob > chi2 = 0.0096

. margins, dydx(fem_educ) predict(pr)

Average marginal effects                          Number of obs   =        500
Model VCE    : OIM

Expression   : Probability of positive outcome, predict(pr)
dy/dx w.r.t. : fem_educ

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    fem_educ |   .0545129   .0066007     8.26   0.000     .0415758      .06745
------------------------------------------------------------------------------

. margins, dydx(*) predict(pr)

Average marginal effects                          Number of obs   =        500
Model VCE    : OIM

Expression   : Probability of positive outcome, predict(pr)
dy/dx w.r.t. : other_inc fem_educ kids male_educ

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   other_inc |   -.014015   .0009836   -14.25   0.000    -.0159428   -.0120872
    fem_educ |   .0545129   .0066007     8.26   0.000     .0415758      .06745
        kids |  -.0470199   .0123397    -3.81   0.000    -.0712052   -.0228346
   male_educ |          0  (omitted)
------------------------------------------------------------------------------

.
页面提取自-r_页面_1.jpg 页面提取自-r_页面_2.jpg 页面提取自-r_页面_3.jpg

二维码

扫码加我 拉你入群

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

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

2014-9-17 12:44:41
蓝色 发表于 2014-9-17 08:00
你用stata自带的例子试试,不要想当然用命令。mfx 是就版本的命令了。
遇到问题,先看帮助和手册
奥,原来是这样,用margins命令就不一样了,多谢O(∩_∩)O
二维码

扫码加我 拉你入群

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

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

2016-9-10 18:43:10
各位,stata14更新后,升级到stata14.2 (stata14.1也有这个问题) margins 命令好像出现幺蛾子了!!我对比了一下stata提供的ivprobit中的例子
发现两个重大区别:
第一,margins 估计出来的系数不一样(值跟原来的不一样了,有的变大,有的变小)
第二,ivprobit中的工具变量male_educ居然还有边际效应!但是注意截图中的文字,“male edu has no effect because it appears only as an instrument”,并且求边际效应, male_educ作为othe_inc的工具变量,理论上也不需要,也求不出来它的边际效应吧?!还请各位牛人指点!详细内容见截图

附件列表
QQ截图20160910184259.png

原图尺寸 127.28 KB

QQ截图20160910184259.png

二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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