[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: xtpcse_postestimation

From   "Skidmore, Mark" <>
To   <>
Subject   st: xtpcse_postestimation
Date   Thu, 30 Aug 2007 11:09:56 -0400

Statalist Users:

I am trying to generate a residual from a regression estimated by

In xtreg (fixed effects), one can estimate the residual in one of two

1) use a command like "predict res if e(sample), e"


2) use a the command "predict yhat if e(sample), xbu" and then "gen res
= y-yhat"  Here it is important to use "xbu" and not "xb" so as to take
into account fixed effects.

The two above approaches yield the same result.

With xtpcse, there is no option to predict the residual directly.  So I
have tried estimating the residual by first getting a prediction of the
dependent variable using "predict yhat if e(sample), xb", and then using
"gen res = y-yhat".  

But I think there is something wrong with this approach.  While the mean
value of the residual is small (0.01), I think it is too far from zero.
The fact that Stata does not offer a residual calculation leads me to
think that this is a more complicated problem.  

Any insights would very much be appreciated.


*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index