Prediction Depends on Whom or What You Want to Predict
For clustered data, “predict the outcome” is not a complete specification of a goal. A prediction might concern a particular clinic whose outcomes have already been observed, a clinic not yet observed, or the average outcome across clinics in a target population. Those targets differ because members of the same cluster may share unobserved characteristics. A GLMM represents such heterogeneity with random effects; a GEE specifies a marginal mean and accounts for within-cluster dependence through a working correlation.
The key choice is therefore not simply which method accommodates clustering. It is which prediction target is needed. A GLMM can support predictions conditional on a cluster’s random effect, as well as population-average predictions obtained by integrating over the random-effects distribution. A GEE directly models the population-average mean. Its working correlation describes dependence for estimation and inference; it does not estimate a latent effect for each cluster.
What the Two Models Predict
Let \(Y_{ij}\) be the outcome for unit \(i\) in cluster \(j\), and let \(x_{ij}\) denote its covariates. In a GLMM, a conditional mean is specified given a random effect \(b_j\):
Here \(g\) is the link, \(\beta\) is the vector of fixed-effect coefficients, and \(z_{ij}\) identifies how the random effect enters the model. The random effects are assumed to follow a specified distribution, commonly \(b_j\sim N(0,\Sigma)\). Conditional on the random effects and covariates, outcomes are assumed to follow the chosen response distribution; in a simple random-intercept model, they are conditionally independent within a cluster. The random-effects distribution, link, response distribution, and conditional-independence structure are modeling assumptions, not consequences of using a GLMM.
For an observed cluster, its fitted random effect can be used to form a conditional prediction. In practice this is usually an estimated random effect, often an empirical Bayes estimate, rather than a known value. For a new cluster, its random effect is unknown; the appropriate mean prediction averages over the random-effects distribution:
A GEE instead specifies the marginal mean directly, for example \(g\{E(Y_{ij}\mid x_{ij})\}=x_{ij}^{\mathsf T}\beta_{\mathrm{marg}}\), together with a working covariance or correlation structure for observations within clusters. The mean-model assumptions and the target population must be appropriate for the intended interpretation. The working correlation need not be exactly correct for a sandwich variance estimator to support large-sample inference under standard conditions, including independent clusters and a sufficiently large number of clusters. But a working correlation is not a fitted cluster effect and does not turn the marginal mean into a prediction conditional on a particular clinic.
Why Conditional and Marginal Predictions Differ
In a nonlinear model, averaging conditional means is generally not the same as evaluating the link inverse at the average linear predictor. For a random-intercept logistic GLMM, for example,
The difference follows because the inverse-logit function is nonlinear: averaging its values over \(b_j\) does not in general equal applying it to the average value of \(b_j\). Even when \(E(b_j)=0\), setting \(b_j=0\) gives a conditional prediction for a cluster with zero random effect, not automatically the population-average prediction. In linear models with an identity link and mean-zero random effects, these means can coincide; that special case should not be assumed for nonlinear links.
Worked Example: A GEE Population-Average Prediction
Suppose a hypothetical binary-outcome study uses a logistic GEE with treatment coded 0 or 1. The fitted marginal mean model is \(\operatorname{logit}(\mu_{ij})=-1.2+0.7x_{ij}\). Calculate the predicted population-average probabilities for the two treatment groups and interpret the treatment coefficient.
For the untreated group, \(x_{ij}=0\), so \(\eta=-1.2\). Thus \(\mu=\operatorname{logit}^{-1}(-1.2)=1/(1+e^{1.2})\approx0.2315\).
For the treated group, \(x_{ij}=1\), so \(\eta=-1.2+0.7=-0.5\). Thus \(\mu=\operatorname{logit}^{-1}(-0.5)=1/(1+e^{0.5})\approx0.3775\).
The fitted population-average probabilities are about 23.15% for the untreated group and 37.75% for the treated group, a difference of approximately 14.60 percentage points. The coefficient \(0.7\) is a marginal log-odds contrast under this model; its exponentiated value is \(e^{0.7}\approx2.014\), a population-average odds ratio. These are model-based associations, not by themselves causal effects. The GEE predictions do not identify which particular cluster will have an outcome probability above or below these marginal means.
Worked Example: Averaging GLMM Predictions for a New Clinic
Consider a hypothetical binary-outcome random-intercept GLMM with conditional model \(\operatorname{logit}\{\mu_j(b_j)\}=-1+b_j\). For a transparent calculation, suppose the specified random-intercept distribution assigns probability 0.5 to each of \(b_j=-0.8\) and \(b_j=0.8\). This is a deliberately simple discrete distribution, not a claim that random effects are normally distributed. Find the conditional probabilities for these two cluster types and the population-average probability for a new clinic.
At \(b_j=0.8\), the linear predictor is \(-1+0.8=-0.2\), giving \(\operatorname{logit}^{-1}(-0.2)\approx0.4501660\). At \(b_j=-0.8\), it is \(-1-0.8=-1.8\), giving \(\operatorname{logit}^{-1}(-1.8)\approx0.1418511\).
A new clinic’s random intercept has not been learned from that clinic’s outcomes. Averaging the conditional probabilities over the specified distribution gives
The predicted probability for a new clinic is therefore about 29.60%. It is not the probability for the clinic with \(b_j=0\), which would be \(\operatorname{logit}^{-1}(-1)\approx0.2689\). In an applied Gaussian random-intercept GLMM, the corresponding average is an integral over the fitted Gaussian distribution, typically evaluated numerically. The answer depends on that distributional assumption.
Choosing a Prediction Target in Practice
The following distinction is useful when the prediction request is stated in words. First ask whether the cluster is observed and whether its outcomes or other information are available to estimate a cluster effect. Then ask whether the requested output is a cluster’s conditional mean or an average for a target population.
| Prediction request | Natural approach | What is predicted |
|---|---|---|
| Mean outcome for an observed clinic, using its data | GLMM | Conditional mean using the clinic’s estimated random effect, with uncertainty in that estimate recognized |
| Mean outcome for a new clinic from the target population | GLMM with integration, or a suitable GEE | Population-average mean; the new clinic’s random effect is not known |
| Average outcome across clinics at specified covariates | GEE, or a marginalized GLMM prediction | Population-average mean under the specified target population and model |
| Which particular patient will have an outcome | Neither mean model alone is sufficient | A binary mean is a probability, not a certain individual outcome; additional prediction assumptions and uncertainty are needed |
A GLMM is especially useful when cluster-level prediction is substantively important and cluster-specific information is available. Its conditional predictions depend on the random-effects distribution and on how well the cluster effect can be estimated. A GEE is a natural choice when the main goal is a population-average mean or contrast and a latent cluster effect is not itself needed. A GEE can also provide a mean prediction for covariates in the target population, subject to its mean-model assumptions; it does not thereby provide a distribution of cluster-specific means.
Neither label guarantees the desired prediction. A GLMM’s fixed-effect predictor with \(b_j\) set to zero is not generally a population-average prediction. Conversely, a GEE’s fitted mean is not a prediction for a specific clinic conditional on that clinic’s history. A prediction for a new cluster from a GLMM requires integrating over the random effects; one for an observed cluster requires estimating its random effect using the available cluster information. These targets should not be conflated when reporting results.
Diagnostics, Failure Modes, and Limits
Prediction quality depends on more than the choice between GLMM and GEE. Check whether the outcome distribution, link, covariates, and functional forms are plausible for the intended mean. For a GLMM, also assess whether the random-effects structure and distribution are credible and whether the cluster-specific estimates are supported by enough information in each cluster. Strong sensitivity of predictions to the assumed random-effects distribution is a warning that population-average predictions may be fragile.
For GEE, examine whether the marginal mean is plausible and whether the sample contains enough independent clusters for the chosen inferential approximations. A sandwich variance estimator does not repair a misspecified mean model, and a sensible working correlation does not create cluster-specific predictions. With few clusters, standard large-sample GEE inference may be unreliable. For either method, predictions far outside the observed covariate range are extrapolations and should be reported cautiously.
The comparison is not a contest to find one universally superior model. A GLMM’s conditional model and a GEE’s marginal model answer different questions; their coefficients need not have the same interpretation or numerical value, particularly with a nonlinear link. A marginal prediction can be obtained from a GLMM by integration, but the resulting quantity inherits the GLMM’s random-effects assumptions. A GEE estimates the marginal mean directly but does not supply a latent-cluster mechanism. The choice should follow the intended prediction target and the assumptions that are defensible for the data.
Worked Example: Matching a Prediction Request to a Model
A hypothetical health network wants (a) the expected event probability for a new clinic and (b) an estimate for one existing clinic after observing its outcomes. The analyst has a binary outcome and a treatment indicator. State a suitable prediction target and approach for each request.
(a) New clinic. The clinic has no outcome history from which to estimate a clinic-specific effect. A GLMM can predict by integrating its conditional probability over the fitted random-intercept distribution. A GEE can directly predict the population-average probability at the specified treatment value. These predictions target a mean for a clinic drawn from the target population, not a particular latent clinic type.
(b) Existing clinic. If the request is conditional on that clinic’s observed outcomes, a GLMM can use its estimated random intercept to produce a cluster-specific mean. The estimate is uncertain, especially if the clinic has few observations. A GEE can still estimate the population-average mean at the covariates, but its working correlation does not yield the clinic-specific conditional mean requested.
The distinction is about the target, not a universal rule that every prediction for a new cluster must use GEE or that every existing-cluster prediction is automatically reliable under a GLMM. The selected model must also have a suitable mean structure and assumptions for the data.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A logistic random-intercept GLMM has a mean-zero random effect. Is the prediction at random effect zero necessarily the population-average probability? Why?
- A GEE uses an exchangeable working correlation. Can that correlation alone predict an individual clinic’s conditional mean? Explain.
- For a new cluster, what must be done to obtain a population-average prediction from a GLMM?
- A model reports a GEE population-average event probability of 0.32. State its interpretation and one conclusion it does not support.
- Name one diagnostic or limitation relevant to each approach when the goal is prediction.
Solutions. (1) No. The population mean is the average of the conditional probabilities over the random-effects distribution; a nonlinear inverse link means this is generally not the probability calculated at \(b_j=0\). (2) No. A working correlation represents within-cluster dependence for estimating the marginal model; it does not estimate a cluster-specific latent effect. (3) Integrate the conditional mean over the fitted random-effects distribution, using numerical integration if needed. (4) At the specified covariates and for the target population, the fitted model predicts a mean event probability of 32%. It does not imply that every clinic has probability 0.32 or that a particular patient will experience the event. (5) For a GLMM, assess random-effects assumptions and whether cluster effects are estimated with enough within-cluster information. For a GEE, check the marginal mean and whether there are enough independent clusters for reliable large-sample inference.