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

st: Re: RE: disagreement between xtreg and xtmixed outputs

From   José Maria Pacheco de Souza <>
To   <>
Subject   st: Re: RE: disagreement between xtreg and xtmixed outputs
Date   Mon, 29 Jun 2009 16:33:35 -0300

Dears  Martin and Joseph:
thank you very much.
Yes, the differences between occasion 1 and occasion 2 for each examiner id were very very close to zero, and in four times were zero.
It is fortunate to have Stata and guys like you.
Best regards,
José Maria
Jose Maria Pacheco de Souza, Professor Titular (aposentado)
Departamento de Epidemiologia/Faculdade de Saude Publica, USP
Av. Dr. Arnaldo, 715
01246-904  -  S. Paulo/SP - Brasil
fones (11)3061-7747; (11)3768-8612;(11)3714-2403
----- Original Message ----- From: "Joseph Coveney" <>
To: <>
Sent: Monday, June 29, 2009 1:36 PM
Subject: st: RE: disagreement between xtreg and xtmixed outputs

José Maria Pacheco de Souza wrote:

I ran xtreg and xtmixed (and 1oneway) with the same dataset but got
different results, as I show bellow:

[output omitted]

I am using version 10 updated, intercooled. The data is in the long format.
I followed the models presented in pages 64 and 65 of  Sophia
Rabe-Hesketh´s Multilevel and Longitudinal Modeling Using Stata, second
edition and really am puzlled with the no concordance of results. Could it
be some problem with my data set (which is not that presented by Sophia)?


You wouldn't necessarily expect exact concordance between -loneway- and iterative asymptotic methods like -xtmixed , ml- or -xtreg , mle-.

Regardless, it looks as if -xtreg , mle- is having trouble with the extremely high intraclass correlation (tiny within-ID variance): for -xtreg , ml-, you've got zero for the standard error of the within-ID variance estimate and missing values for the standard error and confidence limits for the intraclass correlation coefficient. -xtmixed- gets a boost from the expectation-maximization to get its initial estimates into the ballpark before starting the Newton-Raphson iterations where numerical difficulties would arise (note also that -xtreg , ml- has zero iterations).

With only 30 clusters and an expectation of vanishingly small within-cluster variance, I'd suggest staying with -anova-, -loneway- or -xtreg , fe- over the iterative methods.

You can use code below in order to explore the limits of -xtreg , ml- under these kinds of conditions.

Joseph Coveney

clear *
set more off
drawnorm mensuração0 mensuração1, n(30) corr(1 0.99396 \ 0.99396 1) ///
 sd(1.080263 1.080263) means(2.132833 2.132833) ///
 seed(`=date("2009-06-30", "YMD")')
generate byte id = _n
reshape long mensuração, i(id) j(time)

xtreg mensuração, i(id) mle
xtreg mensura, i(id) fe
xtmixed mensuração || id:, ml
loneway mensuração id


*   For searches and help try:

*   For searches and help try:

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