楼主: idzhoucong
9936 10

[面板数据求助] 为什么无论是mfx还是margin,xtprobit、xttobit的系数和边际效应一致? [推广有奖]

11
蓝色 发表于 2015-5-23 21:14:26
你的看xttobit里面的predict的选项
你对比一下tobit的选项

让你看手册和帮助,这些都是里面的例子啊



Title

    [XT] xttobit postestimation -- Postestimation tools for xttobit



Description

    The following postestimation commands are available after xttobit:

    Command            Description
    --------------------------------------------------------------------------------------------------------------
    contrast           contrasts and ANOVA-style joint tests of estimates
    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)
    estimates          cataloging estimation results
    forecast           dynamic forecasts and simulations
    lincom             point estimates, standard errors, testing, and inference for linear combinations of
                         coefficients
    lrtest             likelihood-ratio test
    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
    test               Wald tests of simple and composite linear hypotheses
    testnl             Wald tests of nonlinear hypotheses
    --------------------------------------------------------------------------------------------------------------


Syntax for predict

        predict [type] newvar [if] [in] [, statistic nooffset]

    statistic          Description
    --------------------------------------------------------------------------------------------------------------
    Main
      xb               linear prediction assuming u_i=0, the default
      stdp             standard error of the linear prediction
      stdf             standard error of the linear forecast
      pr0(a,b)         Pr(a < y < b) assuming u_i is zero
      e0(a,b)          E(y | a < y < b) assuming u_i is zero
      ystar0(a,b)      E(y*), y*=max{a,min(y_j,b)} assuming u_i=0

    --------------------------------------------------------------------------------------------------------------
    These statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for
      the estimation sample.

    where a and b may be numbers or variables; a missing (a > .) means minus infinity, and b missing (b > .) means
      plus infinity; see missing.


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.  It can be thought of as the standard error of
        the predicted expected value or mean for the observation's covariate pattern.  The standard error of the
        prediction is also referred to as the standard error of the fitted value.

    stdf calculates the standard error of the linear forecast.  This is the standard error of the point prediction
        for 1 observation.  It is commonly referred to as the standard error of the future or forecast value.  By
        construction, the standard errors produced by stdf are always larger than those produced by stdp; see
        Methods and formulas in [R] regress.

    pr0(a,b) calculates estimates of Pr(a < y < b) assuming u_i is zero, which is the probability that y would be
        observed in the interval (a,b), given the current values of the predictors, x_it, and given a zero random
        effect.  In the discussion that follows, these two conditions are implied.

        a and b may be specified as numbers or variable names;
        pr0(20,30) calculates Pr(20 < y < 30);
        pr0(lb,ub) calculates Pr(lb < y < ub); and
        pr0(20,ub) calculates Pr(20 < y < ub).

        a missing (a > .) means minus infinity; pr0(.,30) calculates Pr(y < 30) and pr0(lb,30) calculates
        Pr(y < 30) in observations for which lb > . (and calculates Pr(lb < y < 30) elsewhere).

        b missing (b > .) means plus infinity; pr0(20,.) calculates Pr(y > 20) and pr0(20,ub) calculates
        Pr(y > 20) in observations for which ub > . (and calculates Pr(20 < y < ub) elsewhere).

    e0(a,b) calculates estimates of E(y | a < y < b) assuming u_i is zero, which is the expected value of y
        conditional on y being in the interval (a,b), meaning that y is truncated.  a and b are specified as they
        are for pr0().

    ystar0(a,b) calculates estimates of E(Y*) assuming u_i is zero, where Y* = a if y < a, Y* = b if y > b, and
        Y* = y otherwise, meaning that Y* is the censored version of y.  a and b are specified as they are for
        pr0().

    nooffset is relevant only if you specified offset(varname) for xttobit.  It modifies the calculations made by
        predict so that they ignore the offset variable; the linear prediction is treated as xb rather than xb +
        offset.


Examples

    Setup
        . webuse nlswork3
        . xtset idcode
        . xttobit ln_wage union age grade not_smsa south##c.year, ul(1.9)

    Average marginal effect of age on expected log wage, conditional on log wage being less than 1.9
        . margins, predict(e0(., 1.9)) dydx(age)







Title

    [R] tobit postestimation -- Postestimation tools for tobit


Description

    The following postestimation commands are available after tobit:

    Command              Description
    --------------------------------------------------------------------------------------------------------------
        contrast         contrasts and ANOVA-style joint tests of estimates
        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
    (1) forecast         dynamic forecasts and simulations
        hausman          Hausman's specification test
        lincom           point estimates, standard errors, testing, and inference for linear combinations of
                           coefficients
        linktest         link test for model specification
    (2) lrtest           likelihood-ratio test
        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
        suest            seemingly unrelated estimation
        test             Wald tests of simple and composite linear hypotheses
        testnl           Wald tests of nonlinear hypotheses
    --------------------------------------------------------------------------------------------------------------
    (1) forecast is not appropriate with svy estimation results.
    (2) lrtest is not appropriate with svy estimation results.


Syntax for predict

        predict [type] newvar [if] [in] [, statistic nooffset]

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

    statistic          Description
    --------------------------------------------------------------------------------------------------------------
    Main
      xb               linear prediction; the default
      stdp             standard error of the linear prediction
      stdf             standard error of the forecast
      pr(a,b)          Pr(a < y < b)
      e(a,b)           E(y|a < y < b)
      ystar(a,b)       E(y*),y* = max{a, min(y,b)}

    --------------------------------------------------------------------------------------------------------------
    These statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted only for
      the estimation sample.
    stdf is not allowed with svy estimation results.

    where a and b may be numbers or variables; a missing (a > .) means minus infinity, and b missing (b > .) means
      plus infinity; see missing.


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 prediction, which can be thought of as the standard error of the
        predicted expected value or mean for the observation's covariate pattern.  The standard error of the
        prediction is also referred to as the standard error of the fitted value.

    stdf calculates the standard error of the forecast, which is the standard error of the point prediction for 1
        observation.  It is commonly referred to as the standard error of the future or forecast value.  By
        construction, the standard errors produced by stdf are always larger than those produced by stdp; see
        Methods and formulas in [R] regress.

    pr(a,b) calculates Pr(a < xb + u < b), the probability that y|x would be observed in the interval (a,b).

        a and b may be specified as numbers or variable names; lb and ub are variable names;
        pr(20,30) calculates Pr(20 < xb + u < 30);
        pr(lb,ub) calculates Pr(lb < xb + u < ub); and
        pr(20,ub) calculates Pr(20 < xb + u < ub).

        a missing (a > .) means minus infinity; pr(.,30) calculates Pr(-infinity < xb + u < 30);
        pr(lb,30) calculates Pr(-infinity < xb + u < 30) in observations for which lb > .
        and calculates Pr(lb < xb + u < 30) elsewhere.

        b missing (b > .) means plus infinity; pr(20,.) calculates Pr(+infinity > xb + u > 20);
        pr(20,ub) calculates Pr(+infinity > xb + u > 20) in observations for which ub > .
        and calculates Pr(20 < xb + u < ub) elsewhere.

    e(a,b) calculates E(xb + u | a < xb + u < b), the expected value of y|x conditional on y|x being in the
        interval (a,b), meaning that y|x is truncated.  a and b are specified as they are for pr().

    ystar(a,b) calculates E(y*), where y* = a if xb + u < a, y* = b if xb + u > b, and y* = xb+u otherwise,
        meaning that y* is censored.  a and b are specified as they are for pr().

    nooffset is relevant only if you specified offset(varname).  It modifies the calculations made by predict so
        that they ignore the offset variable; the linear prediction is treated as xb rather than xb + offset.

    scores calculates equation-level score variables.

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

        The second new variable will contain the derivative of the log likelihood with respect to the scale
        equation (sigma).


Examples

    Setup
        . sysuse auto
        . generate wgt = weight/100
        . tobit mpg wgt, ll(17) ul(24)

    Average marginal effects for all covariates
        . margins, dydx(*)

    Marginal effect on the truncated expected value, conditional on weights of 2000 and 2500 pounds
        . margins, dydx(wgt) predict(e(17,24)) at(wgt=(20 25))

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

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