Statalist


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

st: AW: disagreement between xtreg and xtmixed outputs


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: disagreement between xtreg and xtmixed outputs
Date   Mon, 29 Jun 2009 20:49:35 +0200

<> 

They seem to be in perfect agreement in this example. Does she say anything about -loneway- in the pages cited by you?

*************
webuse nlswork, clear
gen age2 = age*age
gen ttl_exp2 = ttl_exp*ttl_exp
gen tenure2 = tenure*tenure
gen byte black = race==2

xtreg ln_w, mle

xtmixed ln_w || idcode:, mle

/*
have to take the square root
of the results for variance 
to see equivalence
 */ 
 
gllamm ln_w, i(idcode)/*
 */  nip(12) adapt
*************


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von José Maria Pacheco de Souza
Gesendet: Montag, 29. Juni 2009 17:57
An: [email protected]
Betreff: st: disagreement between xtreg and xtmixed outputs 

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

xtreg  mensuração , i(id) mle
Iteration 0:   log likelihood =  -38.39068
Random-effects ML regression                    Number of obs      = 
60
Group variable: id                                        Number of groups 
=        30
Random effects u_i ~ Gaussian                    Obs per group: min = 
2
                                                                   avg = 
2.0
                                                                   max = 
2
                                                                  Wald 
chi2(0)       =      0.00
Log likelihood  =  -38.39068                      Prob > chi2        = 
.

mensuração       Coef.      Std. Err.      z          P>z     [95% Conf. 
Interval]
_cons          2.132833   .1942075    10.98   0.000     1.752194    2.513473

/sigma_u    1.052955   .1387291                                .8133212 
1.363193
/sigma_e    .2134579          0 
.2134579    .2134579
rho    .9605257          .                             .           .
Likelihood-ratio test of sigma_u=0: chibar2(01)=  101.09 Prob>=chibar2 = 
0.000


xtmixed  mensuração ||   id:, mle
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0:   log likelihood = -23.147063
Iteration 1:   log likelihood = -23.147063

Computing standard errors:
Mixed-effects ML regression                     Number of obs      = 
60
Group variable: id                                      Number of groups   = 
30
                                                                 Obs per 
group: min =         2
                                                                 avg = 
2.0
                                                                 max = 
2

                                                                  Wald 
chi2(0)       =         .
Log likelihood = -23.147063                     Prob > chi2        = 
.


mensuração       Coef.       Std. Err.      z         P>z     [95% Conf. 
Interval]
_cons             .132833   .1942075    10.98   0.000     1.752194 
2.513473

Random-effects Parameters     Estimate   Std. Err.     [95% Conf. Interval]
id: Identity
           sd(_cons)    1.062051   .1375417       .823967    1.368929

           sd(Residual)    .0841923   .0108692      .0653706    .1084331
LR test vs. linear regression: chibar2(01) =   131.58 Prob >= chibar2 = 
0.0000


. loneway  mensuração id
One-way Analysis of Variance for mensuração:
Number of obs =        60
R-squared =    0.9969

Source                            SS         df          MS            F 
Prob > F

Between id             67.889766        29    2.3410264    330.26     0.0000
Within id                    .21265011     30    .00708834
Total                     68.102416          59    1.1542782

Intraclass       Asy.
correlation      S.E.       [95% Conf. Interval]
------------------------------------------------
0.99396     0.00222       0.98962     0.99831

Estimated SD of id effect               1.080263
Estimated SD within id                  .0841923
Est. reliability of a id mean            0.99697
(evaluated at n=2.00)

. dis sqrt(2.3410264)
1.5300413

. dis sqrt(.00708834)
.08419228

. dis 1.062051^2/((1.062051^2)+(.0841923^2))
.99375499

. dis 1.052955^2/(( 1.052955^2)+(.2134579^2))
.96052575

 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)?
Thank you for any advice.
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
www.fsp.usp.br/~jmpsouza 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index