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]

Re: st: heteroskedasticity test in panel data

From   "Michael N. Mitchell" <>
Subject   Re: st: heteroskedasticity test in panel data
Date   Wed, 28 Jul 2010 10:23:04 -0700

Dear Kit

In that case, is the Stata FAQ (at on which this code example is based also backward? I summarize bits of it below...

        . xtgls ... , igls panels(heteroskedastic)
        . estimates store hetero

to fit the model with panel-level heteroskedasticity and save the likelihood.

We can fit the model without heteroskedasticity by typing

        . xtgls ...

Now there is one trick. Normally, lrtest infers the number of constraints when we fit nested models by looking at the number of parameters estimated. For xtgls, however, the panel-level variances are estimated as nuisance parameters and their count is NOT included in the parameters estimated. So, we will need to tell lrtest how many constraints we have implied.

The number of panels/groups is stored in e(N_g) and, in the second model, we are constraining all of these to be single value, so our number of constraints can be computed and stored in a local macro by typing

        . local df = e(N_g) - 1

The test is then obtained by typing

        . lrtest hetero . , df(`df')


Michael N. Mitchell
Data Management Using Stata      -
A Visual Guide to Stata Graphics -
Stata tidbit of the week         -

On 2010-07-28 6.24 AM, Christopher Baum wrote:
On Jul 28, 2010, at 2:33 AM, Jing wrote:

. lrtest hetero ., df(620)

Likelihood-ratio test                                            LR chi2(620)=  -6436.22
(Assumption: hetero nested in .)                       Prob>  chi2 =    1.0000

Backwards! Homo is a special case of hetero, which explains why you're getting a NEGATIVE Chi-square value. You have to
give the arguments to lrtest in the right order.

A positive Chi-square of 6400 with a large df has a p-value of zero, not one.


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

*   For searches and help try:
*   For searches and help try:

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