Statalist


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

Re: st: RE: r-square 4-level-logit-regression xtmelogit


From   Martina Brandt <[email protected]>
To   [email protected]
Subject   Re: st: RE: r-square 4-level-logit-regression xtmelogit
Date   Tue, 16 Oct 2007 10:51:40 +0200

Dear Nick, dear list,

this is what I did - and what I got, using the same samples:

1) gllamm

xi: gllamm y x1...xn , i(l2 l3 l4) link(logit) family (binom) from(a) nip(10) adapt robust eform

/*Results (part):
Variances and covariances of random effects
------------------------------------------------------------------------------

***level 2 (l2)

var(1): 1.5149127 (.55028054)

***level 3 (l3)

var(1): 2.1240474 (.52440731)

***level 4 (l4)

var(1): .02896267 (.02613964)
*/
gllapred phat1
sum phat1

/*
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
phat1 | 7680 -2.010795 1.506836 -7.667717 3.125869
*/

2)xtmelogit
xi: xtmelogit y x1...xn || l4: || l3: || l2:, variance or

/*
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
land: Identity |
var(_cons) | .022862 .0201887 .0040499 .1290577
-----------------------------+------------------------------------------------
hhnr: Identity |
var(_cons) | 2.171575 .4617767 1.43143 3.294423
-----------------------------+------------------------------------------------
beobnr: Identity |
var(_cons) | 1.434772 .5741192 .6549036 3.143318
------------------------------------------------------------------------------
*/
predict phat2
sum phat2

/*
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
phat2 | 7680 .2411294 .2457556 .0005897 .9551997
*/

-> the ("explained") variance (SD(phat2)^2) now is much smaller compared to the overall variance than in the first example using gllamm. I must have overlooked something important, but I have no idea, what that could be? is it that predict (option mu) produces somethind different to gllapred? would i have to take only the fixed part (predict, xb)?

by the way: the example in the help function also indicates the level-1-indicator, but this produces the same results, just takes a lot longer. Does anyone know more about that?

Sorry for bothering you that extensively!

martina

_________________________
Martina Brandt
Universit�t Z�rich
Soziologisches Institut
Andreasstr. 15
CH-8050 Z�rich
Tel. +41(0)44 6352347

www.suz.uzh.ch/ages


Nick Cox schrieb:

If you can demonstrate that results that should be the same, from the same data and the same model, are different from -xtmelogit- and -gllamm-, then there is a problem.
I think you need at least to show (examples of) the commands you used and the results you got for experts on these commands to comment.
Nick [email protected]
Martina Brandt


Dear Nic, thanks a lot for your answer - i know that pseudo-r-squares are quite tricky. But the probem here is, that the same pseudo-r-square changes using xtmemixed instead of gllamm because the estimated variance of phat in comparison to the level 1 to level 4 variances is much smaller than it is using gllamm?!

  On Mon, 15 Oct 2007 17:03:56 +0100
  "Nick Cox" <[email protected]> wrote:
There is a entire bestiary of pseudo-R-squares
based on different kinds of analogy to R-square, strong, weak and otherwise. There is no
reason in general why they should agree.
Martina Brandt

mc kelvey and zavoina suggest an r2 for multilevel logit
regression,
which is the variance of the predicted probabilities
divided by the
total variance of the model (=proportion of explained variance). in the four level model this would be (var(phat))/((var(phat)+((pi2)/3))+var(level2)+var(level3)+var
(level4))
(see snijders & bosker 1999: 225).
using gllamm i always had pseudo r2 around 0.20, and now using xtmelogit it is supposed to be only around 0.01. does anyone have an
idea, why
this could have happened and how these differences could
be explained?
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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