Statalist


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

Re: st: gllamm vs xtlogit results


From   jlinhart@stata.com (Jean Marie Linhart, StataCorp LP)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: gllamm vs xtlogit results
Date   Mon, 04 Feb 2008 15:07:28 -0600

"Anderson, Bradley J" <BAnderson1 at lifespan dot org>

> I'll start by pleading ignorant but I estimated what I think is the same
> random intercepts logistic regression model using gllamm and xtlogit (Stata
> version 9.0).  There are 245 groups observed a total of 21,449 times. The
> number of observations per group ranged from 33 to 90.

> Here are the model commands:
>
> . gllamm sexday adrk age white cocfreq alsf06 sexwork if modaci==0, i(sid) link(logit) family(binomial) eform
> . xtlogit sexday adrk age white cocfreq alsf06 sexwork if modaci==0, i(sid) or

Bradley does not quite get the same results from these two models and he asks:

> Are these estimating the same model?  And if so, why would some estimated
> coefficients and standard errors be so different?  And finally, how do I
> figure out what results to trust?  As an aside, I estimated the population
> averaged effects using both xtgee and logistic with standard errors adjusted
> for clustering.  Substantive conclusions were similar to xtlogit.

Austin Nichols <austinnichols at gmail dot com> and Hind Sbihi <sbihi at
interchange dot ubc dot ca> have already provided some comments for Bradley
on what might be occurring in his model. 

I observe that these two runs are not quite the same.  The -gllamm- model uses
non-adaptive quadrature, and -xtlogit- uses adaptive quadrature. They also do
not use the same number of integration points (8 for -gllamm- and 12 for
-xtlogit- by default).

I am not sure that Bradley is using enough integration points here with 
-gllamm- or -xtlogit-.  He can use -quadchk- after -xtlogit- to determine if
his results vary with the number of integration points.  Ideally, he would like
to see results that agree to a relative difference of .0001.  If he does not
have tight agreement, he should add integration points and see if this fixes
the problem.  Once Bradley has confirmed he is using enough integration points,
he should use that many with both -gllamm- and -xtlogit-.  He should get
results in closer agreement when using enough integration points (and
the same number of integration points) with both -gllamm- and -xtlogit-.  See
-help quadchk- for more information.

The option to specify integration points with -gllamm- is -nip()-, and with
-xtlogit- the option is -intpoints()-.

Bradley should make sure both -gllamm- and -xtlogit- are using adaptive
quadrature to compare apples to apples.  He could also use non-adaptive
quadrature for both, but adaptive quadrature is better.  I suggest that Bradley
add the -adapt- option to the -gllamm- model.

--Jean Marie
jlinhart@stata.com
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index