# Re: st: correlation estimates in gee

 From rgutierrez@stata.com (Roberto G. Gutierrez, StataCorp) To statalist@hsphsun2.harvard.edu Subject Re: st: correlation estimates in gee Date Mon, 05 Oct 2009 16:48:24 -0500

```David Jeffries <djeffries@mrc.gm> asks:

> How is the exchangeable correlation parameter (alpha) estimated for a
> generalised estimating equation?

> For a binomial family with unbalanced panels, it is not as listed (Karim's
> implementation) on page 140 of the longitudinal/panel data manual (Stata
> 11). It doesn't appear to be Liang and Zeger's 1986 implementation either,
> although comments within the xtgee ado code say it is?

> Within xtgee it is calculated as scalar `alpha' = `alpha'*`phi'/`cF'

> phi is the sum of squared Pearson residuals / total observations cF is
> 0.5*sum(ni*(ni-1)), where ni are the panel sizes

> From the ado code I can't understand how alpha itself is actually evaluated
> as I can't follow this line of code?

> _GEEUC `ei' `ww', a(`alpha') ty(`corr') n(`maxni')

> where alpha actually appears to be evaluated.

David's assertion that alpha is not calculated as listed on page 140 of the
[XT] manual is correct.  There is a typo in the formula for alpha listed
there.  The outer sums from i = 1 to M in the two main terms being divided
need to be brought into their respective numerators and denominators in order
to correspond to the calculation made by -xtgee-.  We'll make this correction
to the documentation.

That stated, the calculation performed currently by -xtgee- does correspond to
that of Liang of Zeger (1986), with one exception.  Their paper uses a divisor
of N - p, where p is the number of regressors, and by default -xtgee- uses a
divisor of N.  To have -xtgee- use a divisor of N - p instead, you can use
option -nmp-, in which case you fully recover the Liang and Zeger estimator.

That -xtgee- reproduces Liang and Zeger (1986) can be difficult to see from
the ado code, because a key component is calculated by the internal routine
-_GEEUC-.  However, if David wishes he can email one of us privately and we
can supply a .do file that we have developed while researching this question.
That do-file reproduces -xtgee-'s alpha calculation on a particular dataset,
and does so following Liang and Zeger.

Reference:

Liang, K.-Y. and S. L. Zeger. 1986. Longitudinal data analysis using
generalized linear models.  Biometrika 73: 13-22.

--Bobby					--Theresa
rgutierrez@stata.com			tboswell@stata.com
*
*   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/
```