Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: testing random effects with xtmixed

From (Roberto G. Gutierrez, StataCorp)
Subject   Re: st: testing random effects with xtmixed
Date   Thu, 05 Oct 2006 09:38:51 -0500

Hillel Alpert <> asked:

>> How can the effect of a particular level be tested with xtmixed for a
>> multi-level model?  For example, how can we test the significance of region,
>> school, and/or class?

>> xtmixed depvar indep || region: || school: || class:

>> Advice would be greatly appreciated.

and Maarten Buis <> responded:

> In essence you want to test whether the variance of the random region
> specific intercept is zero. Stata will report standard errors for the
> variances, but Wald test (parameter divided by the se is standard normal) is
> problematic since the null hypothesis is on the border of the allowable
> values of a variance. You could estimate a model with random effects on the
> region level and one without and do a likelihood ratio test. You'll have to
> take care to specify the mle option to make that valid, since by default
> -xtmixed- uses restricted maximum likelihood (reml). You can repeat that for
> the school and class levels.

Actually, LR tests using REML are perfectly valid, PROVIDED that you don't
change the fixed-effects part of the model (in -xtmixed-, the fixed-effects
part is the varlist before the initial ||).  

Given a set fixed-effects structure, the difference between ML and REML is
just an additive constant in the log space, so an LR test statistic, which is
twice the difference between two log (restricted) likelihoods is invariant to
ML vs. REML.

Another way to think about this is to realize that REML is just ML with the 
fixed effects contrasted out of the model.  As such, if you are contrasting
the same set of fixed effects, REML has all the properties of ML, such as 
a facility for LR tests.

That being said, you needn't worry about this distinction.  -lrtest- is 
smart enough to detect whether you've changed the fixed effects in a REML 
mixed model, and will issue the appropriate error message.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index