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

st: Residuals in ivreg and xtivreg

From   "Paulo Regis" <>
Subject   st: Residuals in ivreg and xtivreg
Date   Wed, 14 May 2008 12:13:48 +0100

Dear all,

Comparing ivreg and xtivreg, I found different residuals (and the same
issue arises with reg and xtreg). Imagine you have a panel of
countries. The output of ivreg and xtivreg are equivalent if they are
expressed as

xi: ivreg y (l.y = l.x1 l.x2) x1 x2,
predict r, resid

xtivreg y (l.y = l.x1 l.x2) x1 x2 , i(country) fe
predict xb, xb
gen r=y-xb

where I have a dependent and 2 independent variables, and a fixed
effect for each country. However, there is a large difference in the
residuals. Why is this? I need the residuals to check for serial
correlation but I am not sure about the way to follow. The difference
is quite significant since for ivreg i get positive serial correlation
while xtivreg shows negative serial correlation.

If you consider the residuals from ivreg is more convenient, I would
appretiate your answer is clear enough so I can get them from ivreg
since I would like to avoid the presentation of the fixed effects from
the final regression output.


*   For searches and help try:

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