楼主: aihui2003
4945 7

[回归分析求助] stata如何获取oprobit模型的残差值? [推广有奖]

  • 1关注
  • 0粉丝

硕士生

70%

还不是VIP/贵宾

-

威望
0
论坛币
4695 个
通用积分
1.2000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
564 点
帖子
17
精华
0
在线时间
350 小时
注册时间
2011-9-4
最后登录
2024-1-8

20论坛币
那位仁兄知道stata如何获取oprobit模型的残差值?谢谢

关键词:oprobit模型 oprobit Probit Stata tata 模型 如何
沙发
statax 发表于 2015-12-1 15:43:44 |只看作者 |坛友微信交流群
试试这个:
predict yhat, xb
gen resid=y-yhat
已有 1 人评分经验 热心指数 收起 理由
夏目贵志 + 5 + 1 热心帮助其他会员

总评分: 经验 + 5  热心指数 + 1   查看全部评分

使用道具

藤椅
donwayho 发表于 2017-4-15 21:29:13 |只看作者 |坛友微信交流群
statax 发表于 2015-12-1 15:43
试试这个:
predict yhat, xb
gen resid=y-yhat
请问用你这种方式得到的残差和用predict de, de得到的deviance residual有什么区别呢?

使用道具

板凳
蓝色 发表于 2017-4-15 21:57:03 |只看作者 |坛友微信交流群
donwayho 发表于 2017-4-15 21:29
请问用你这种方式得到的残差和用predict de, de得到的deviance residual有什么区别呢?
predict de, de

oprobit没有上面这个命令
已有 1 人评分论坛币 热心指数 收起 理由
statax + 8 + 1 精彩帖子

总评分: 论坛币 + 8  热心指数 + 1   查看全部评分

使用道具

报纸
蓝色 发表于 2017-4-15 21:57:41 |只看作者 |坛友微信交流群
donwayho 发表于 2017-4-15 21:29
请问用你这种方式得到的残差和用predict de, de得到的deviance residual有什么区别呢?
predict de, de

oprobit没有上面这个命令



Title

    [R] oprobit postestimation -- Postestimation tools for oprobit


Description

    The following postestimation commands are available after oprobit:

    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
        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 mi or svy estimation results.
    (2) lrtest is not appropriate with svy estimation results.


Syntax for predict

        predict [type] {stub* | newvar | newvarlist} [if] [in] [, statistic
                outcome(outcome) nooffset]

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

    statistic          Description
    ----------------------------------------------------------------------------
    Main
      pr               predicted probabilities; the default
      xb               linear prediction
      stdp             standard error of the linear prediction
    ----------------------------------------------------------------------------
    If you do not specify outcome(), pr (with one new variable specified)
      assumes outcome(#1).
    You specify one or k new variables with pr, where k is the number of
      outcomes.
    You specify one new variable with xb and stdp.
    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 +----------------------------------------------------------------

    pr, the default, calculates the predicted probabilities.  If you do not also
        specify the outcome() option, you specify k new variables, where k is
        the number of categories of the dependent variable.  Say that you fit a
        model by typing oprobit result x1 x2, and result takes on three values.
        Then you could type predict p1 p2 p3 to obtain all three predicted
        probabilities.  If you specify the outcome() option, you must specify
        one new variable.  Say that result takes on the values 1, 2, and 3.
        Typing predict p1, outcome(1) would produce the same p1.

    xb calculates the linear prediction.  You specify one new variable, for
        example, predict linear, xb.  The linear prediction is defined, ignoring
        the contribution of the estimated cutpoints.

    stdp calculates the standard error of the linear prediction.  You specify
        one new variable, for example, predict se, stdp.

    outcome(outcome) specifies for which outcome the predicted probabilities are
        to be calculated.  outcome() should contain either one value of the
        dependent variable or one of #1, #2, ..., with #1 meaning the first
        category of the dependent variable, #2 meaning the second category, etc.

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

    scores calculates equation-level score variables.  The number of score
        variables created will equal the number of outcomes in the model.  If
        the number of outcomes in the model was k, then

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

        The other new variables will contain the derivative of the log
        likelihood with respect to the cutpoints.

使用道具

地板
donwayho 发表于 2017-4-16 08:47:40 |只看作者 |坛友微信交流群
蓝色 发表于 2017-4-15 21:57
predict de, de

oprobit没有上面这个命令
恩  是的oprobit模型中没有,我看错了。请问 probit模型中的残差通过什么方式求是正确的,我试了一下楼上的方法和predict de, de 两种方法求的不一样,两者区别在什么地方呢?

使用道具

7
蓝色 发表于 2017-4-16 19:56:33 |只看作者 |坛友微信交流群
donwayho 发表于 2017-4-16 08:47
恩  是的oprobit模型中没有,我看错了。请问 probit模型中的残差通过什么方式求是正确的,我试了一下楼上 ...
你用的什么命令,就看那个命令的help的解释

如果没有现成命令,就自己手动求

使用道具

8
peyzf 发表于 2020-3-5 19:11:31 |只看作者 |坛友微信交流群
学习了,版主威武

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-6-23 03:10