The xttest2 routine, published in SJ 1-1, has been updated to correct a
deficiency and add better error messages. Trevis Certo pointed out its
anomalous behavior, which was the result of ignoring the time variable
(i.e. allowing its use after xtreg ,fe i(), which does not require
specification of t() via tis nor tsset). This makes the routine
incapable of handling unbalanced panels properly. Although the routine
will still run in Stata 6 or better, it now requires that tsset has
been issued prior to its use.
Associated with this problem is the possibility that the number of
common observations across a panel might be very small (either 2 or 1).
In the former case, the correlation matrix of residuals is singular. In
the latter case, it does not exist. The routine now provides more
informative error messages in both instances, and refuses to run in the
former case.
The revised routine is available via ssc install xttest2.