Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: heteroskedasticity test in panel data


From   "Michael N. Mitchell" <[email protected]>
To   [email protected]
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 http://www.stata.com/support/faqs/stat/panel.html) 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')

Thanks!

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com



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



Kit Baum   |   Boston College Economics&  DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                               An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
    An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index