= Solution
Use a <generalized estimating equation> with any well-behaved positive-definite <working correlation matrix>. Let $\gamma$ collect the marginal intercept and slopes, let $m_i(\gamma)$ be the vector of three correct marginal means, and put $D_i=\partial m_i/\partial\gamma^{\mathsf T}$. Write the working <covariance> as $V_i=A_i^{1/2}R_i(\alpha)A_i^{1/2}$, where the proposed Poisson <variance> gives $A_i=\operatorname{diag}(m_i)$; working <independence> is also allowed. Solve
$$
\boxed{\sum_{i=1}^mD_i^{\mathsf T}V_i^{-1}(Y_i-m_i)=0}.
$$
At the true mean, each cluster residual has <expectation> zero, so the estimating equation is unbiased regardless of whether $V_i$ equals the actual <covariance>. With <independent> students, sufficient covariate variation and regularity as $m\to\infty$, this gives consistent mean coefficients.
Replace the model-based <covariance> by the cluster-level <sandwich covariance matrix>. Evaluated at the fitted values, define
$$
\widehat A=\sum_iD_i^{\mathsf T}V_i^{-1}D_i,\qquad
\widehat B=\sum_iD_i^{\mathsf T}V_i^{-1}r_ir_i^{\mathsf T}V_i^{-1}D_i,
\qquad r_i=Y_i-\widehat m_i.
$$
Then
$$
\boxed{\widehat{\operatorname{Cov}}(\widehat\gamma)
=\widehat A^{-1}\widehat B\widehat A^{-1}}.
$$
The residual outer products estimate the actual within-student variability, including correlations and extra-Poisson <variance> absent from the working model. Use these <standard errors> for asymptotic <Wald tests> and <confidence intervals>; exponentiating the treatment coefficient and its interval gives the mean-count <rate ratio> and interval. Treating the $3m$ observations as <independent> when forming the sandwich meat would miss the within-student dependence. The effective asymptotic replication is the number of students, so a small number of clusters requires further finite-sample care rather than assuming that three measurements per student repair the large-sample approximation.
Back to article page