Tutorials › Generalized Linear Mixed Models (GLMM) › Cluster-Level Predictors In GLMMs And GEE

GLMM Versus GEE · Tutorial 128 of 698

Cluster-Level Predictors In GLMMs And GEE

Learn why a school-level exposure has different conditional and population-averaged interpretations in GLMM and GEE analyses, and how to report each without overstating what the data show.

Intermediate 10 min read

What You'll Learn

  • Identify when an exposure varies between schools but not among students within a school.
  • Interpret a GLMM coefficient as a conditional, school-random-effect-specific contrast.
  • Interpret a GEE coefficient as a population-averaged contrast.
  • Explain why logistic GLMM and GEE coefficients can differ even with the same exposure.
  • Recognize that the number of schools, not just the number of students, matters for school-level inference.
  • Check assumptions and avoid causal claims unsupported by the study design.

Why the Level of the Exposure Matters

Suppose a school district assigns an intervention to some schools, and researchers record an outcome for each student. Every student in a given school shares that school's assignment. The intervention is therefore a cluster-level predictor: it varies between schools, but not among students within a school. This structure affects both what a coefficient compares and where the information about the intervention comes from.

A GLMM and a GEE can both represent the association between school assignment and student outcomes while accounting for clustered observations. But their coefficients generally answer different questions. In a GLMM, the intervention coefficient is conditional on the school random effect. In a GEE, it describes a population-averaged contrast. These interpretations are especially important for nonlinear links such as the logit, where averaging probabilities does not preserve odds ratios.

Definition: A predictor is cluster-level when its value is constant for all observations in a cluster and may vary across clusters. For students \(i\) in schools \(j\), write this exposure as \(A_j\). A GLMM coefficient for \(A_j\) is conditional on the specified random effects; a GEE coefficient for \(A_j\) is marginal over the within-school outcome distribution, under the specified mean model.

Two Models, Two Interpretations

For a binary student outcome \(Y_{ij}\), let \(A_j=1\) indicate that school \(j\) received the intervention and \(A_j=0\) indicate control. A random-intercept logistic GLMM can be written as

$$ \operatorname{logit}\{P(Y_{ij}=1\mid b_j,A_j)\} =\beta_0+\beta_A A_j+b_j, \qquad b_j\sim N(0,\sigma_b^2). $$

Here \(b_j\) represents a school's latent deviation in outcome propensity, and the model assumes that the random intercepts follow the stated normal distribution and are independent of the modeled predictors. Holding \(b_j\) fixed, \(\exp(\beta_A)\) is the intervention-to-control odds ratio. It compares students in schools with the same value of the random intercept, under this model. It is therefore a conditional or school-random-effect-specific odds ratio, not an odds ratio obtained by averaging across schools.

A logistic GEE instead specifies the marginal mean directly. In a simple model with no additional covariates, it can be written as

$$ \operatorname{logit}\{P(Y_{ij}=1\mid A_j)\} =\gamma_0+\gamma_A A_j. $$

In this model, \(\exp(\gamma_A)\) compares the population-averaged odds of the outcome for students in intervention schools with those for students in control schools. “Population-averaged” refers to the mean outcome across the distribution of schools represented by the model; it does not mean that each school has the same outcome probability.

The exposure’s level also constrains what can be learned from the data. Because \(A_j\) is identical for every student in school \(j\), there is no within-school intervention-versus-control contrast. The intervention coefficient is informed by differences between schools. Adding more students to a small number of schools may improve information about each school's outcomes, but it does not create additional independently assigned schools.

Worked Example: Interpreting School-Level Coefficients

Imagine a hypothetical cluster-randomized trial in which 40 schools, with 20 assigned to each arm, contribute student binary outcomes. Suppose a GLMM gives \(\hat{\beta}_A=0.588\) with standard error \(0.200\), and a GEE gives \(\hat{\gamma}_A=0.405\) with standard error \(0.180\). Interpret the coefficients and calculate approximate 95% Wald confidence intervals.

For the GLMM, exponentiating the coefficient gives the conditional odds ratio:

$$ \exp(0.588)=1.80. $$

Thus, under the fitted random-intercept model, the estimated odds of the outcome are 1.80 times as high in intervention schools as in control schools at the same random-intercept value. The Wald interval on the log-odds scale is \(0.588\pm1.96(0.200)\), or \(0.196\) to \(0.980\). Exponentiating both endpoints gives

$$ \left(\exp(0.196),\exp(0.980)\right)=(1.22,2.66). $$

This is an approximate 95% confidence interval for the conditional odds ratio. Its interpretation is conditional on the GLMM and its assumptions.

For the GEE, the marginal odds ratio estimate is

$$ \exp(0.405)=1.50. $$

It describes an estimated 1.50-fold ratio of population-averaged outcome odds between intervention and control schools. The log-scale interval is \(0.405\pm1.96(0.180)\), or \(0.0522\) to \(0.758\), giving the odds-ratio interval

$$ \left(\exp(0.0522),\exp(0.758)\right)=(1.05,2.13). $$

These are hypothetical estimates, not results from an actual trial. Both intervals exclude 1 at the stated approximate 95% level, but the two point estimates are not estimates of the same odds-ratio estimand. Their difference is not, by itself, evidence that one method is wrong.

Why the Logistic Coefficients Can Differ

The key issue is that a logistic model is nonlinear. In a random-intercept GLMM, the conditional success probability for a school is \(\operatorname{expit}(\beta_0+\beta_A A_j+b_j)\), where \(\operatorname{expit}(u)=1/\{1+\exp(-u)\}\). The marginal probability averages this quantity over the distribution of \(b_j\). In general, averaging probabilities and then taking their odds is not the same as holding the random effect fixed and taking conditional odds.

$$ P(Y_{ij}=1\mid A_j) =\int \operatorname{expit}(\beta_0+\beta_A A_j+b)\, f(b)\,db \ne \operatorname{expit}(\beta_0+\beta_A A_j). $$

Consequently, the marginal log odds contrast obtained after integrating over schools is generally not \(\beta_A\). This is a form of non-collapsibility: conditional and marginal odds ratios can differ even without confounding. The difference does not require a different intervention definition or a different sign of association. With an identity link and an additive random intercept, by contrast, the marginal mean difference can equal the conditional fixed-effect difference under the model; that equality does not generally extend to the logit link.

Worked Example: Averaging Changes an Odds Ratio

Use a simple hypothetical random-intercept illustration in which half of schools have \(b_j=-1\) and half have \(b_j=1\). Let the conditional control log odds at \(b_j=0\) be \(-1\), and let the conditional intervention coefficient be \(\log(2)=0.693\). This two-point distribution is chosen to make the calculation transparent; it is not the normal random-effects distribution used in the model above.

At a fixed random effect, the conditional odds ratio is \(\exp(0.693)=2\). To calculate the marginal probabilities, average the two school-specific probabilities for each arm. For control, these are \(\operatorname{expit}(-2)=0.1192\) and \(\operatorname{expit}(0)=0.5000\), so

$$ \bar p_0=\frac{0.1192+0.5000}{2}=0.3096. $$

For intervention, the corresponding linear predictors are \(-1+0.693-1=-1.307\) and \(-1+0.693+1=0.693\). The probabilities are approximately \(0.2130\) and \(0.6667\), giving

$$ \bar p_1=\frac{0.2130+0.6667}{2}=0.4399. $$

The marginal odds ratio is therefore

$$ \frac{\bar p_1/(1-\bar p_1)}{\bar p_0/(1-\bar p_0)} = \frac{0.4399/0.5601}{0.3096/0.6904} \approx 1.75. $$

The conditional odds ratio is 2.00, while the marginal odds ratio is about 1.75. Both calculations use the same treatment effect in the conditional model; the difference arises from averaging across schools with different baseline propensities.

Assumptions, Design, and Practical Checks

The interpretation of either coefficient depends on how the exposure was assigned and on whether the mean model is appropriate. In a randomized school-level trial, assignment at the school level supports a causal comparison of assigned intervention strategies, provided the study's design and outcome ascertainment avoid relevant sources of bias. In an observational comparison, an association between \(A_j\) and the outcome is not automatically causal. Differences between intervention and control schools—such as resources, location, or baseline achievement—could explain some or all of the observed contrast.

The GLMM adds assumptions about the random-effects distribution and its relationship to predictors. In particular, the usual random-intercept formulation assumes the random intercept is independent of the included predictors. If schools with higher latent outcome propensity are also more likely to receive the intervention, that assumption may be implausible. A GEE targets a marginal mean and does not require a random-effects distribution, but it still needs an adequately specified mean model and valid inference for clustered data. Both approaches need enough independent clusters for reliable large-sample inference; many students within only a few schools do not substitute for a substantial number of schools.

Before interpreting a cluster-level coefficient, check the following:

  • Confirm the assignment level. Verify that the exposure is truly constant within schools. If it varies among students, it is not purely a cluster-level predictor.
  • Count the independent units. Record the number of schools in each exposure group, not only the total number of students.
  • Check overlap and confounding. In an observational study, assess whether intervention and control schools differ systematically in measured characteristics and whether the analysis addresses them appropriately.
  • Check model fit and coding. Confirm the reference group, outcome coding, link, and covariate specification. Interpret the coefficient using the model actually fitted.
  • Compare like with like. Do not treat a conditional GLMM odds ratio and a marginal GEE odds ratio as interchangeable estimates or use their numerical difference alone as a model diagnostic.

Worked Example: What Is the Effective Exposure Contrast?

Suppose a hypothetical study includes 300 students from 12 schools: six intervention schools and six control schools, with 25 students per school. The intervention indicator is \(A_j=1\) for all 25 students in each intervention school and \(A_j=0\) for all 25 students in each control school.

There are 150 students per arm, but there are only six intervention and six control assignment units. The model cannot compare intervention and control students within any one school, because no school contains both assignment values. Thus, the treatment contrast is between the six intervention schools and the six control schools.

A report that treats all 300 student records as if they were independently assigned would misrepresent how the exposure varies and could understate uncertainty. A GLMM or GEE must account for clustering, and the small number of schools also warrants caution about large-sample inference. Adding students within these same 12 schools does not change the fact that only 12 schools were assigned.

Choosing and Reporting the Interpretation

Neither model is universally preferable just because its coefficient is larger or smaller. The choice should follow the scientific question. A GLMM is useful when the question concerns differences conditional on school-specific latent propensity or when subject- or cluster-specific predictions are needed. A GEE is useful when the target is an average contrast across the population of students or schools represented by the analysis. For a cluster-level intervention, state the estimand and the assignment unit explicitly rather than reporting only “the intervention effect.”

For a logistic analysis, a clear report names the outcome, exposure, comparison, and scale. For example: “The GLMM estimated a conditional odds ratio of 1.80 for the student outcome, comparing intervention with control schools at the same random-intercept value.” Or: “The GEE estimated a population-averaged odds ratio of 1.50 for students in intervention versus control schools.” If the study is observational, describe these as adjusted associations unless a defensible causal design and assumptions support a causal interpretation.

The central limitation is not a defect unique to either method: the cluster-level contrast is supported by variation across clusters. Few schools, poor overlap, or strong school-level confounding can make the result imprecise or difficult to interpret, even when the student count is large. Model-based adjustment does not manufacture assignment-level information that the design did not collect.

Key takeaway: A cluster-level predictor is compared between clusters. A GLMM coefficient is conditional on the modeled random effects, whereas a GEE coefficient is population-averaged. For nonlinear links, those are distinct estimands; report the model, scale, and level of comparison.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. A school-level binary intervention has a GLMM logit coefficient of \(0.40\). What is the conditional odds ratio, and what is held fixed in its interpretation?
  2. Why can a logistic GEE odds ratio differ from the odds ratio in a logistic random-intercept GLMM even when both use the same school-level intervention?
  3. A study has 800 students in eight schools, with four schools assigned to each arm. What is the number of school-level assignment units per arm, and why does the student total not answer that question?
  4. In an observational school comparison, intervention schools have higher baseline resources. Does a fitted intervention coefficient establish a causal effect? Explain.

Solutions. (1) \(\exp(0.40)=1.49\), so the conditional odds are estimated to be 1.49 times as high under intervention as under control at the same random-intercept value. (2) The GLMM coefficient is conditional on random effects, whereas GEE describes a marginal mean; averaging probabilities through a nonlinear logit link generally changes the odds ratio. (3) There are four assignment units per arm. The intervention is assigned by school, so 800 student records do not represent 800 independent assignments. (4) No. Higher resources may confound the association; causal interpretation requires a suitable design and assumptions that address systematic differences between schools.

Clinical Biostats