全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件
3472 2
2019-03-02
先做了简单最小二乘回归,sysuse auto, clear

regprice weight mpg turn foreign

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

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



二维码

扫码加我 拉你入群

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

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

全部回复
2019-3-5 10:34:55
predict e  等价于 predict e,xb
预测的是线性拟合值

predict e,res
预测的是回归残差
二维码

扫码加我 拉你入群

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

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

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.
二维码

扫码加我 拉你入群

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

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

栏目导航
热门文章
推荐文章

说点什么

分享

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