Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Saving residuals in xtivreg2

    Hi all,

    I'm running the following regression:
    xtivreg2 cycle_mean trade total_trades shares volatility jan feb mar apr may jun jul aug sep oct nov (take_cycle=event), fe cluster(stock1) first
    I would like to save the residuals of the regression. The help to xtivreg2 suggests using predict newvar, e. However the same command is used to save the first difference of the residual. See below. When I plot the residual obtained with the predict command, it does look like a first difference. How do I get the residuals. Any help will be appreciated.

    Elvira

    From help xtivreg2
    For the fixed-effects estimator, statistic is

    e v_it, the idiosyncratic component of the error term

    and is available only for the estimation sample.

    For the first-differences estimator, statistic is

    e v_it - v_it-1, the first-differenced idiosyncratic component


  • #2
    Elvira - I'm not sure what you mean. The way the first-differences estimator works is that (1) every variable is first-differenced, and then (2) the FD of the dep var is regressed on the FDs of the indep vars (some of which can be instrumented with FDs of the IVs). So the residual from this regression is indeed (v_it-v_it-1) (with a hat on top of the whole thing, because it's a residual and the actual disturbances are unobserved). Have a look at the postestimation help and manual entry for official xtivreg for an explanation.

    Comment


    • #3
      Related to this, how would I save residuals following the regression? I'm using the xtivreg28 command. predict varname does not save anything. I need to obtain the residuals, not the first difference. Thank you.

      Comment

      Working...
      X