楼主: Juliet的日常
3559 2

[其他] 简单最小二乘回归后,预测残差时是否要加res [推广有奖]

  • 0关注
  • 2粉丝

已卖:19份资源

博士生

57%

还不是VIP/贵宾

-

威望
0
论坛币
1116 个
通用积分
31.3704
学术水平
148 点
热心指数
84 点
信用等级
77 点
经验
4966 点
帖子
269
精华
0
在线时间
243 小时
注册时间
2018-10-10
最后登录
2025-7-16

楼主
Juliet的日常 学生认证  发表于 2019-3-2 15:08:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
先做了简单最小二乘回归,sysuse auto, clear

regprice weight mpg turn foreign

预测残差时,老师给的步骤是 predict e, res

我自己试了一下,后面加和不加res都能预测出值但是结果不一样,有没有大神可以告知以下加res和不加res分别代表什么呢?



二维码

扫码加我 拉你入群

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

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


沙发
steventung 发表于 2019-3-5 10:34:55
predict e  等价于 predict e,xb
预测的是线性拟合值

predict e,res
预测的是回归残差
已有 1 人评分论坛币 收起 理由
admin_kefu + 20 热心帮助其他会员

总评分: 论坛币 + 20   查看全部评分

藤椅
蓝色 发表于 2019-3-5 13:15:34
Syntax for predict

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

    statistic            Description
    ----------------------------------------------------------------------------------------------
    Main
      xb               linear prediction; the default
      residuals          residuals

      score             score; equivalent to residuals
      rstandard          standardized residuals
      rstudent           Studentized (jackknifed) residuals
      cooksd             Cook's distance
      leverage | hat       leverage (diagonal elements of hat matrix)
      pr(a,b)            Pr(y | a < y < b)
      e(a,b)             E(y | a < y < b)
      ystar(a,b)         E(y*), y* = max(a,min(y,b))
    * dfbeta(varname)    DFBETA for varname
      stdp               standard error of the linear prediction
      stdf               standard error of the forecast
      stdr               standard error of the residual
    * covratio           COVRATIO
    * dfits              DFITS
    * welsch             Welsch distance
    ----------------------------------------------------------------------------------------------
    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.
    rstandard, rstudent, cooksd, leverage, dfbeta(), stdf, stdr, covratio, dfits, and welsch are
      not available if any vce() other than vce(ols) was specified with regress.
    xb, residuals, score, and stdp are the only options 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.
已有 1 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
admin_kefu + 40 + 5 + 5 + 5 热心帮助其他会员

总评分: 论坛币 + 40  学术水平 + 5  热心指数 + 5  信用等级 + 5   查看全部评分

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-7 19:19