Tutorials › Generalized Linear Models › Poisson GEE for Clustered Counts

Generalized Estimating Equations · Tutorial 852 of 981

Poisson GEE for Clustered Counts

Learn to build and interpret a Poisson GEE cluster score, including the effect of exchangeable working correlation on estimation.

Advanced 12 min read

What You'll Learn

  • Specify a marginal log-link Poisson mean model for clustered counts
  • Derive the cluster score from the GEE matrix expression
  • Calculate exchangeable working-correlation weights for two observations
  • Compare independence and correlated GEE estimates in an unequal-size example
  • Distinguish a GEE estimating function from a joint likelihood score

Why a Poisson GEE for Clustered Counts?

Counts such as clinic visits, infections, or emergency-department arrivals are often recorded repeatedly for the same person, or for people grouped within a clinic. A Poisson mean model gives a useful starting point when the response is a count and its mean should remain positive. But repeated observations within a cluster may be associated, so treating every count as independent can use the wrong residual weighting.

A Poisson generalized estimating equation (GEE) combines a marginal mean model with a working covariance matrix for each cluster. The mean model determines the population-average relationship of interest; the working covariance determines how residuals within a cluster contribute to estimating its coefficients. The working covariance need not be the true covariance for the estimating equation to have mean zero when the marginal mean is correctly specified, though a different working covariance can produce a different finite-sample estimate.

Mean Model and Cluster Estimating Equation

Let \(Y_{ij}\) be the count for observation \(j\) in cluster \(i\), where \(i=1,\ldots,K\) and \(j=1,\ldots,m_i\). Clusters are independent of one another; observations within a cluster may be dependent. Let \(x_{ij}\) be a \(p\)-component covariate vector, including an intercept if appropriate. The log-link marginal mean model is

$$ \mu_{ij}=E[Y_{ij}\mid x_{ij}]=\exp(x_{ij}'\beta). $$

For a Poisson marginal variance specification, \(\operatorname{Var}(Y_{ij}\mid x_{ij})=\mu_{ij}\). This specifies the one-observation variance used in the GEE; it does not assert that observations within a cluster are independent. Write \(Y_i=(Y_{i1},\ldots,Y_{im_i})'\), \(\mu_i=(\mu_{i1},\ldots,\mu_{im_i})'\), and let \(X_i\) be the \(m_i\) by \(p\) matrix whose rows are \(x_{ij}'\). Define \(A_i=\operatorname{diag}(\mu_{i1},\ldots,\mu_{im_i})\).

Definition: For working correlation matrix \(R_i(\alpha)\) and dispersion \(\phi>0\), the working covariance matrix is \(V_i=\phi A_i^{1/2}R_i(\alpha)A_i^{1/2}\). The Poisson GEE is \(U(\beta)=\sum_{i=1}^K D_i'V_i^{-1}(Y_i-\mu_i)=0\), where \(D_i=\partial\mu_i/\partial\beta'=A_iX_i\). A GEE estimate is a solution of this estimating equation; it is not, in general, a maximum-likelihood estimate.

The matrix \(R_i(\alpha)\) is a working correlation matrix: it is used to weight residuals, and its parameters may be estimated from the data. For a two-observation exchangeable working correlation with correlation \(\rho\), \(R_i=\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}\), where \(|\rho|<1\) ensures positive definiteness. Setting \(R_i=I\) gives the independence working correlation.

Deriving the Poisson Cluster Score

The log link gives \(\partial\mu_{ij}/\partial\beta=\mu_{ij}x_{ij}\), so \(D_i=A_iX_i\). Substituting this derivative and the working covariance into the GEE yields a convenient expression for the contribution \(U_i(\beta)\) from cluster \(i\).

Result: For the Poisson variance function and the working covariance above,
$$ U_i(\beta) =\frac{1}{\phi}X_i'A_i^{1/2}R_i(\alpha)^{-1}A_i^{-1/2}(Y_i-\mu_i). $$

To verify the expression, use \(V_i^{-1}=\phi^{-1}A_i^{-1/2}R_i^{-1}A_i^{-1/2}\). Then

$$ D_i'V_i^{-1} =X_i'A_i\left(\phi^{-1}A_i^{-1/2}R_i^{-1}A_i^{-1/2}\right) =\phi^{-1}X_i'A_i^{1/2}R_i^{-1}A_i^{-1/2}. $$

This derivation shows exactly where the working correlation enters: it acts on standardized residuals \(A_i^{-1/2}(Y_i-\mu_i)\), and the resulting vector is scaled by \(A_i^{1/2}\) and projected onto the covariates. Under independence, the expression simplifies to \(U_i=X_i'A_i^{-1}(Y_i-\mu_i)\) only if read incorrectly; the correct simplification is \(U_i=X_i'(Y_i-\mu_i)/\phi\), since \(A_i^{1/2}I A_i^{-1/2}=I\). Thus each observation contributes its covariate vector times its raw residual, up to the common dispersion factor.

Worked Example: A Two-Observation Cluster Score

At a specified coefficient value, suppose a cluster has fitted means \(\mu_i=(1,4)'\), covariate rows \(x_{i1}'=(1,0)\) and \(x_{i2}'=(1,1)\), observed counts \(Y_i=(2,2)'\), \(\phi=1\), and exchangeable working correlation \(\rho=1/2\). Calculate its contribution to the two coefficient equations.

The residual is \(Y_i-\mu_i=(1,-2)'\), and its standardized version is \(A_i^{-1/2}(Y_i-\mu_i)=(1,-1)'\), since \(A_i^{1/2}=\operatorname{diag}(1,2)\). The correlation matrix and its inverse are

$$ R_i=\begin{pmatrix}1&1/2\\1/2&1\end{pmatrix}, \qquad R_i^{-1}=\begin{pmatrix}4/3&-2/3\\-2/3&4/3\end{pmatrix}. $$

Indeed, multiplying these matrices gives the identity. Applying the inverse to the standardized residual gives \(R_i^{-1}(1,-1)'=(2,-2)'\). Multiplication by \(A_i^{1/2}\) gives \((2,-4)'\), and projection by \(X_i'\) gives

$$ U_i(\beta)= \begin{pmatrix}1&1\\0&1\end{pmatrix} \begin{pmatrix}2\\-4\end{pmatrix} =\begin{pmatrix}-2\\-4\end{pmatrix}. $$

The first entry is the intercept-equation contribution, and the second is the slope-equation contribution. Under independence, the same cluster contributes \(X_i'(Y_i-\mu_i)=(-1,-2)'\). The change is due to the working-correlation weighting, not a change in the observed counts or fitted means.

What Exchangeable Correlation Does to an Intercept Score

A particularly transparent case is an intercept-only model, so every observation has the same mean \(\mu=\exp(\beta)\). Suppose a cluster has size \(m\) and exchangeable working correlation \(R=(1-\rho)I+\rho\mathbf{1}\mathbf{1}'\), with \(-1/(m-1)<\rho<1\) when \(m>1\). Here \(\mathbf{1}\) is the \(m\)-vector of ones. The cluster contribution can be reduced to a scalar multiple of its total residual.

Result: In this intercept-only exchangeable case, the cluster contribution is
$$ U_i(\beta)=\frac{\sum_{j=1}^{m_i}(Y_{ij}-\mu)} {\phi\{1+(m_i-1)\rho\}}. $$

To derive it, \(A_i=\mu I\), so the factors \(A_i^{1/2}\) and \(A_i^{-1/2}\) cancel, leaving \(U_i=\phi^{-1}\mathbf{1}'R_i^{-1}(Y_i-\mu\mathbf{1})\). Since \(R_i\mathbf{1}=\{1+(m_i-1)\rho\}\mathbf{1}\), it follows that \(R_i^{-1}\mathbf{1}=\{1+(m_i-1)\rho\}^{-1}\mathbf{1}\). Symmetry of \(R_i^{-1}\) then gives \(\mathbf{1}'R_i^{-1}=\{1+(m_i-1)\rho\}^{-1}\mathbf{1}'\), proving the formula. The denominator is positive under the stated exchangeable validity bounds. □

Thus a cluster total residual is divided by a size-dependent factor. For \(\rho>0\), larger clusters receive less weight relative to their number of observations than under independence. If all clusters have the same size, this factor is common to every cluster and cancels from the estimating equation; with unequal sizes, it can change the estimate.

Worked Example: Unequal Cluster Sizes Change the Intercept Estimate

Consider two independent clusters under an intercept-only Poisson mean model. Cluster 1 has size one and count \(4\). Cluster 2 has size two and counts \(0,0\). Use exchangeable working correlation \(\rho=1/2\), and set \(\phi=1\). Compare the independence and exchangeable GEE estimates of \(\mu\) and \(\beta=\log\mu\).

With independence, the equation is the sum of all raw residuals: \((4-\mu)+(0-\mu)+(0-\mu)=0\). Therefore \(3\mu=4\), so \(\hat\mu_{\mathrm{ind}}=4/3\) and \(\hat\beta_{\mathrm{ind}}=\log(4/3)\).

With exchangeable correlation, the size-one cluster has denominator \(1+(1-1)\rho=1\), and the size-two cluster has denominator \(1+(2-1)\rho=3/2\). The equation is

$$ (4-\mu)+\frac{(0-\mu)+(0-\mu)}{3/2}=0, \qquad 4-\mu-\frac{4\mu}{3}=0. $$

Hence \(4=7\mu/3\), so \(\hat\mu_{\mathrm{exch}}=12/7\) and \(\hat\beta_{\mathrm{exch}}=\log(12/7)\). These differ from the independence estimates: \(12/7\approx1.714\), whereas \(4/3\approx1.333\). The difference follows from the size-dependent cluster weights, not from a different marginal mean model.

A Direct Check of the Inverse-Correlation Weight

Even in a simple cluster, the inverse correlation matrix can change a score in ways that are easy to miscalculate. For two observations with equal fitted means, the standardized residuals are the raw residuals divided by the common square root of the mean. The following calculation checks the inverse and the resulting intercept contribution explicitly.

Worked Example: Checking a Two-Count Residual Calculation

Suppose the fitted means are both \(\mu\), the residual vector is \((1,-2)'\), \(\phi=1\), and the exchangeable correlation is \(\rho=1/2\). Find the intercept contribution.

The inverse is \(R^{-1}=\begin{pmatrix}4/3&-2/3\\-2/3&4/3\end{pmatrix}\). Multiplication gives \(R^{-1}(1,-2)'=(8/3,-10/3)'\), whose components sum to \(-2/3\). The common-mean factors \(A^{1/2}\) and \(A^{-1/2}\) cancel in the score, so

$$ U_i=\mathbf{1}'R^{-1}(1,-2)'=\frac{8}{3}-\frac{10}{3}=-\frac{2}{3}. $$

Equivalently, \(\mathbf{1}'R^{-1}=(2/3,2/3)\), and its product with \((1,-2)'\) is \((2/3)(1-2)=-2/3\). Both routes agree. This check is useful because an incorrect inverse can produce a plausible-looking but wrong cluster contribution.

Interpretation, Assumptions, and a Common Pitfall

In a log-link marginal model, \(\beta_r\) describes a population-average log-mean change per unit increase in covariate \(r\), holding the other covariates fixed. Exponentiating a coefficient gives the corresponding multiplicative mean ratio. The GEE uses the marginal means and the cluster residual weights to estimate these coefficients. It does not require a fully specified joint distribution for all counts within a cluster.

For the usual unbiasedness argument, assume independent clusters, finite relevant expectations, a correctly specified marginal mean conditional on the covariates, and a working covariance/inverse that is well-defined and determined by covariates or by nuisance quantities treated as fixed in the estimating equation. Then \(E[Y_i-\mu_i\mid X_i]=0\), and consequently \(E[U_i(\beta_0)\mid X_i]=0\). The choice of working correlation can affect efficiency and the realized estimate; it does not repair a misspecified mean model. Robust sandwich inference addresses covariance misspecification under its regularity conditions, but does not make a wrong mean model correct.

  • Pitfall: treating the Poisson working variance as proof of independence. The marginal Poisson variance specifies the diagonal entries of the working covariance. The off-diagonal entries are supplied by \(R_i(\alpha)\); a nonidentity working correlation explicitly allows within-cluster dependence.
  • Pitfall: multiplying by \(R_i^{-1}\) but forgetting the variance scaling. For unequal fitted means, the score weights standardized residuals, not raw residuals alone. The factors \(A_i^{1/2}\) and \(A_i^{-1/2}\) must remain in the expression.
  • Pitfall: calling the GEE a Poisson likelihood score. Marginal Poisson distributions do not specify a joint likelihood for dependent observations. The GEE is an estimating equation built from marginal means and a working covariance.
  • Pitfall: claiming correlation always changes the coefficient estimate. In the intercept-only exchangeable case with equal cluster sizes, the common cluster weight cancels from the equation. Unequal sizes, covariate patterns, or means can make the weighting consequential, but a change is not automatic.
Key takeaway: For Poisson GEE, the log-link derivative is \(D_i=A_iX_i\), and the cluster score is \(X_i'A_i^{1/2}R_i^{-1}A_i^{-1/2}(Y_i-\mu_i)/\phi\). The working correlation changes how within-cluster residuals contribute; the marginal mean model remains the target of estimation.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. For a Poisson log-link model, what are \(D_i\) and \(A_i\), and how do they enter the cluster GEE contribution?
  2. For a two-observation exchangeable working correlation with \(\rho=1/2\), calculate \(R^{-1}(1,-1)'\).
  3. In an intercept-only exchangeable model, why can unequal cluster sizes change the estimate while equal cluster sizes do not introduce size-dependent relative weights?
  4. Does specifying Poisson marginal variances imply that repeated counts within a cluster are independent? Explain.
  5. In the unequal-size example, identify the exchangeable cluster weight for each cluster and explain why the fitted mean differs from the independence estimate.
Clinical Biostats