Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: xttest2

From   Christopher Baum <>
To   "" <>
Subject   st: Re: xttest2
Date   Tue, 2 Apr 2013 13:28:37 +0000

Nicolas wrote

> I want to be able to test for heteroscedasticity (preferably Breusch-Pagan)
> after running an instrumented regression on an unbalanced panel.
> When I use xttest2 after ivreg2 I get the following error:
> ***********
> Error: too few common observations across panel.
> no observations
> r(2000);
> ***********
> Does anyone now how I can get around this error? Or maybe a command that
> does work.

-xttest2-  requires that SOME observations are present in all panels, as it is computing the correlations across panels of the residual vectors. So

webuse grunfeld
ivreg2 invest (mvalue = kstock time)

however if you create imbalance in the panels, so that there are no years in common across all firms, 

drop if year<1945 & company==1
drop if year >1944 & company==2
ivreg2 invest (mvalue = kstock time)

the Breusch-Pagan test cannot be performed, as casewise deletion in the matrix of residuals leaves no usable observations, as the error message says. You can get around the error by restricting your analysis to those periods when all panels are observed; -xttest2- will then work fine.

author -xttest2- (SSC)

Kit Baum   |   Boston College Economics & DIW Berlin   |
                             An Introduction to Stata Programming  |
  An Introduction to Modern Econometrics Using Stata  |

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index