请选择 进入手机版 | 继续访问电脑版
楼主: 玲子12
7646 6

[其他] 面板数据取残差的困惑 [推广有奖]

  • 0关注
  • 0粉丝

小学生

92%

还不是VIP/贵宾

-

威望
0
论坛币
497 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
94 点
帖子
5
精华
0
在线时间
15 小时
注册时间
2007-10-21
最后登录
2013-3-1

玲子12 在职认证  发表于 2012-7-26 09:40:57 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我为写论文刚接触stata呵,要取面板数据固定效应回归后的残差做另一个模型的因变量,刚看了相关的帖子,不是很明白,取残差是用predict u,u predict e,e这两个命令然后u+e就代表残差么?还是用predit yhat,xb   gen residual=y-yhat
这样的命令啊,希望高手可以指点下,谢谢啦!
二维码

扫码加我 拉你入群

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

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

关键词:面板数据 Residual predict Stata resid 因变量 论文 模型

蓝色 发表于 2012-7-26 18:32:24 |显示全部楼层 |坛友微信交流群
自己找一个数据
用哪些命令执行一下,然后比较一下大小就知道了。

另外,你需要看命令的help或者manual,里面都是有介绍和解释的。

Syntax for predict

    For all but the population-averaged model

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


    Population-averaged model

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


    statistic      Description
    -------------------------------------------------------------------------------------------------------
    Main
      xb           xb, fitted values; the default
      stdp         calculate standard error of the fitted values
      ue           u_i + e_it, the combined residual
    * xbu          xb + u_i, prediction including effect
    * u            u_i, the fixed- or random-error component
    * e            e_it, the overall error component

    -------------------------------------------------------------------------------------------------------
    Unstarred statistics are available both in and out of sample; type predict ... if e(sample) ... if
      wanted only for the estimation sample.  Starred statistics are calculated only for the estimation
      sample, even when if e(sample) is not specified.


    PA_statistic   Description
    -------------------------------------------------------------------------------------------------------
    Main
      mu           probability of depvar; considers the offset()
      rate         probability of depvar
      xb           calculate linear prediction
      stdp         calculate standard error of the linear prediction
      score        first derivative of the log likelihood with respect to xb
    -------------------------------------------------------------------------------------------------------
    These statistics are available both in and out of sample; type predict ... if e(sample) ... if wanted
      only for the estimation sample.


Menu

    Statistics > Postestimation > Predictions, residuals, etc.


Options for predict

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

xb calculates the linear prediction, that is, a + bx_it.  This is the default for all except the population-averaged model.

    stdp calculates the standard error of the linear prediction.  For the fixed-effects model, this   excludes the variance due to uncertainty about the estimate of u_i.

    mu and rate both calculate the predicted probability of depvar.  mu takes into account the offset(), and rate ignores those adjustments.  mu and rate are equivalent if you did not specify offset().   mu is the default for the population-averaged model.

    ue calculates the prediction of u_it + e_it.

    xbu calculates the prediction of a + bx_it + u_i, the prediction including the fixed or random  component.

    u calculates the prediction of u_i, the estimated fixed or random effect.

    e calculates the prediction of e_it.


    score calculates the equation-level score.

    nooffset is relevant only if you specified offset(varname) for xtreg.  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.

使用道具

玲子12 在职认证  发表于 2012-7-26 20:06:07 |显示全部楼层 |坛友微信交流群
恩,好的,谢谢指点

使用道具

suiyuehong 发表于 2015-8-16 16:43:15 |显示全部楼层 |坛友微信交流群
蓝色 发表于 2012-7-26 18:32
自己找一个数据
用哪些命令执行一下,然后比较一下大小就知道了。
您好!我想知道获得残差后,如何分析残差的信息?用什么方法?如何看。谢谢!

使用道具

mmo_king 发表于 2016-7-27 18:49:12 |显示全部楼层 |坛友微信交流群
我和楼主的问题一样,到底最后用的什么命令啊,看不懂

使用道具

predict res , e 用来计算残差,其中res是可以随便起的一个名字  只要自己知道这个是残差就行,这个就是在面板数据模型中求残差的方法
已有 2 人评分学术水平 热心指数 信用等级 收起 理由
复羡二龙去6 + 1 + 1 + 1 精彩帖子
星空tcl + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 2  信用等级 + 2   查看全部评分

使用道具

1737 发表于 2020-2-26 18:17:48 |显示全部楼层 |坛友微信交流群
nkwangxu@gmail 发表于 2018-3-7 14:42
predict res , e 用来计算残差,其中res是可以随便起的一个名字  只要自己知道这个是残差就行,这个就是在 ...
您好,请问一下,如果下面出现(3,192 missing values generated)是表示残差项为0吗

使用道具

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

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

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

GMT+8, 2024-3-29 09:03