I must immediately apologise to Richard here. His -hetgrot2- _did_ work.
But, being thick, I called -hetgrot [panelvar]- instead! However, check
this out (from the same -xtgls- model):
. gwhet2
Testing for Groupwise heteroscedasticity
Ho: homoscedasticity
H1: groupwise heteroscedasticity by pano
chi2 (575) = 543.80
Prob>chi2 = 0.8205
. hetgrot2 pano
(option xb assumed; fitted values)
(615 missing values generated)
(617 missing values generated)
Testing for Groupwise heteroscedasticity
Ho: homoscedasticity
H1: groupwise heteroscedasticity by pano
chi2(62) = 543.80
Prob > chi2 = 0.0000
As Richard rightly says, the chi-squared values are indeed identical. But
one rejects H0 whilst the other retains H0. Which to choose?
I think we have to declare -gwhet2- the winner. Note that the d.f. are
different. You have 576 groups, so 575 is the correct d.f. The -hetgrot2-
I sent you is probably fixable (maybe the data just need sorting or
something) but -gwhet2- looks like a tidier program anyway. I haven't
tried Michael's variation, but it looks like it might have some additional
checks for missing data that would be worth incorporating into a final
program. Like I said in my last posting though, while these recent
variations are much better than the original -hetgrot-, I'm not sure any of
them are doing things exactly the way that Greene says it should be
done. Still, they may be close enough.