Resource

GEE vs Mixed-Effects Models: How to Choose for Repeated-Measures and Longitudinal Data

Choosing between GEE and mixed-effects models begins with the estimand: whether the scientific target is a population-average response or a subject-specific trajectory or conditional effect. This Resource explains how outcome type, within-person dependence, random effects, and missing-data assumptions shape that decision.

Researchers choosing between GEE and mixed-effects models are not simply choosing two different techniques for correcting standard errors. They are choosing statistical models that can represent different scientific targets and different explanations of within-person dependence.

The most useful starting question is not “Which method is better?”

What quantity do you want your regression coefficient to describe?

If the target is change in the population-average response, a marginal model fitted using generalized estimating equations (GEE) is often directly aligned with that goal. If the target involves individual-specific trajectories, heterogeneity between individuals, or effects conditional on subject-level random effects, a mixed-effects model may be more appropriate.

For continuous outcomes under linear models, this distinction is less dramatic because averaging a linear mixed model over its random effects preserves the linear marginal mean. For noncontinuous outcomes with nonlinear links, however, population-averaged and subject-specific regression parameters can have genuinely different interpretations (Fitzmaurice et al., 2011).

Why ordinary regression is not enough for repeated measurements

Repeated observations from the same individual are generally dependent. A person's response at one occasion is likely to provide information about that person's response at another occasion, making the usual independence assumption of ordinary regression inappropriate for longitudinal data (Fitzmaurice et al., 2011).

Several processes can generate this dependence. Individuals differ in their underlying propensity to respond: some consistently have higher outcomes and others lower outcomes. There may also be serial biological variation, so measurements close together in time tend to be more alike than measurements far apart. Measurement error contributes another source of within-person variability.

These mechanisms can produce positive within-person correlation and, in many settings, correlation that decreases as the separation between measurement occasions increases (Fitzmaurice et al., 2011).

Repeated measures analysis therefore needs to address two related components:

  1. The mean structure: How does the expected outcome change with time, treatment, exposure, or other covariates?
  2. The dependence structure: How are repeated observations from the same person related?

GEE and mixed-effects models approach the second component differently.

What is GEE?

Generalized estimating equations provide an approach for fitting marginal models to correlated outcomes. The regression model describes the expected response as a function of covariates at the population level, while the within-subject association is handled separately through a working covariance or correlation structure (Fitzmaurice et al., 2011; McCulloch & Searle, 2001).

This separation is fundamental to GEE.

A marginal GEE question: How does the mean response in the population differ between exposure groups or change over time?

The within-person correlation is important because it affects estimation and uncertainty, but it is not necessarily itself the scientific target.

What does “population-averaged” mean?

In a marginal model, the regression coefficients describe covariate associations with the population mean response, rather than changes within an individual conditional on that individual's latent characteristics or random effects (Fitzmaurice et al., 2011).

For example, with repeated binary outcomes and a marginal logistic model, a treatment coefficient describes the treatment contrast on the log-odds scale for the population-average response specified by that model.

That is different from asking how treatment changes the odds for two observations belonging to individuals with the same value of an underlying subject-specific random effect.

The GEE working correlation

GEE requires a working covariance matrix. It is called “working” because it is an approximation to the true covariance structure; it need not equal the true covariance unless the variance and within-subject association models have been correctly specified (Fitzmaurice et al., 2011).

Common working correlation structures include:

Independence

Repeated observations are treated as uncorrelated in the working structure.

Exchangeable / compound symmetry

Every pair of measurements within an individual shares the same working correlation.

Autoregressive

Measurements become less strongly correlated as their temporal separation increases.

Unstructured

Different pairs of occasions can have different correlations.

m-dependent structures

Correlation is allowed within a specified lag structure.

Fitzmaurice et al. describe these as available working structures for GEE, including independence, exchangeable, first-order autoregressive, m-dependent, and unstructured forms (Fitzmaurice et al., 2011).

The working correlation should therefore be treated as a modeling decision, not as a decorative software option.

What if the working correlation is wrong?

The appeal of GEE is that the covariance structure is not required to be perfectly specified in the same way as a full joint probability model. McCulloch and Searle describe GEE as beginning with a marginal generalized linear model and show how working variance-covariance structures can replace an independence working assumption (McCulloch & Searle, 2001).

In practice, GEE commonly uses an empirical or sandwich variance estimator rather than relying entirely on the model-based covariance estimate. Fitzmaurice et al. explicitly distinguish these empirical sandwich standard errors from model-based standard errors (Fitzmaurice et al., 2011).

Important limitation: Robustness to working-correlation misspecification should not be interpreted as robustness to every other modeling problem. The mean model still matters, missingness can invalidate ordinary GEE, and sandwich-based large-sample inference can perform poorly when the number of independent subjects or clusters is limited. Fitzmaurice et al. note that finite-sample Wald tests based on the sandwich estimator can be liberal (Fitzmaurice et al., 2011).

What is a mixed-effects model?

A mixed-effects model contains both fixed effects and random effects.

In longitudinal applications, fixed effects represent systematic population-level components of the model, such as treatment, time, baseline covariates, and treatment-by-time interactions. Random effects represent subject-level departures from those population patterns (Fitzmaurice et al., 2011).

A linear mixed-effects model can be written conceptually as:

Yi = Xiβ + Zibi + εi

where:

  • Xiβ describes the fixed-effects portion of the trajectory;
  • Zibi describes subject-specific departures through random effects;
  • εi represents remaining within-subject variation.

The term mixed refers to the simultaneous presence of fixed and random effects (Fitzmaurice et al., 2011).

Random intercepts

A random intercept allows individuals to have different underlying response levels.

Conceptually, the population has an average intercept, but each individual may start above or below that population value.

This is one way a mixed model explains why observations from the same individual resemble one another: measurements from that person share the same random intercept.

Random slopes

A random slope allows the rate of change to vary between individuals.

Instead of assuming that everyone follows exactly the same time trajectory around different starting levels, the model can allow some individuals to increase more quickly and others more slowly.

With random intercepts and slopes, the covariance between repeated observations becomes a function of the random-effect covariance parameters and measurement times. Fitzmaurice et al. note that relatively parsimonious random-effects structures can therefore generate complex longitudinal covariance patterns (Fitzmaurice et al., 2011).

Fixed effects versus random effects

The phrase fixed versus random effects often causes unnecessary confusion because it is sometimes treated as if variables themselves were inherently “fixed” or “random.”

For longitudinal mixed models, a more useful distinction is between:

  • effects describing the systematic mean structure; and
  • effects representing subject-specific deviations from that structure.

For example, time might have a fixed effect representing average change in the population while simultaneously having a random slope representing variation in rates of change between individuals.

Mixed models consequently do more than merely “adjust for repeated observations.” They explicitly model sources of between-person and within-person variability and can be used to predict individual trajectories (Fitzmaurice et al., 2011).

GEE versus mixed models: the estimand comes first

The central decision is the intended interpretation.

Key distinctions between GEE and mixed-effects models
Question GEE Mixed-effects model
Primary estimand Marginal/population-average mean relationship Conditional/subject-specific relationship when random effects enter a nonlinear model; linear mixed models also imply a marginal mean
Typical interpretation How does the population mean response change with the covariate? How does the response change conditional on the modeled subject-specific random effects?
Within-person correlation Represented through a working covariance/correlation structure Induced partly or wholly through shared random effects; additional residual covariance structures may also be modeled
Random effects Not required for the standard marginal GEE formulation Central feature of mixed-effects models
Individual heterogeneity Correlation is acknowledged without requiring a latent subject-specific explanation Heterogeneity can be represented explicitly through random intercepts, random slopes, or other random coefficients
Individual trajectory prediction Not the primary purpose Naturally supported by the random-effects framework
Continuous repeated outcomes Possible, but implementation and variance structure require attention Linear mixed models are a major likelihood-based framework
Binary, count, and other noncontinuous outcomes Generalized estimating equations extend marginal generalized linear models Generalized linear mixed models extend mixed modeling through nonlinear links
Population averaged vs subject specific Directly targets population-average regression effects With nonlinear links, fixed-effect coefficients generally have subject-specific/conditional interpretations
Correlation specification Working independence, exchangeable, autoregressive, unstructured, and related structures Random-effect covariance structure plus, where modeled, within-subject residual covariance
Missingness considerations Ordinary unweighted GEE is not generally protected against outcome-history-dependent MAR dropout; standard validity is more restrictive Correctly specified likelihood-based longitudinal models can use incomplete trajectories under MAR assumptions
Common use cases Scientific questions explicitly targeting average response differences or average longitudinal trends Questions involving individual heterogeneity, random trajectories, hierarchical structure, or conditional effects

(Fitzmaurice et al., 2011; McCulloch & Searle, 2001).

Population-averaged versus subject-specific effects

This distinction matters most for noncontinuous outcomes.

For linear mixed-effects models with an identity link, averaging over the random effects produces a familiar marginal mean of the form:

E(Yi | Xi) = Xiβ

Thus the fixed effects can describe the population mean even though the model also includes subject-specific random effects (Fitzmaurice et al., 2011).

With nonlinear link functions, the situation changes.

Fitzmaurice et al. emphasize that fixed-effect parameters in generalized linear mixed models are generally not comparable with marginal regression parameters. In the mixed model, they describe covariate effects conditional on subject-specific effects; in the marginal model, regression parameters describe effects on the population mean response (Fitzmaurice et al., 2011).

For example, a logistic random-effects model does not generally reduce, after averaging over its random effects, to a logistic regression model having the same coefficient interpretation for the marginal probabilities (Fitzmaurice et al., 2011).

Interpretation matters: Two correctly fitted models can produce different-looking coefficients without either model necessarily being “wrong.” They may be answering different questions.

Continuous outcomes: the distinction is often more about covariance and heterogeneity

For a continuous outcome analyzed using an identity-link linear model, the GEE-versus-mixed-model distinction is less stark at the level of the mean regression coefficients.

A linear mixed model retains a population mean Xiβ after averaging over the random effects while also decomposing variability and allowing prediction of subject-specific trajectories (Fitzmaurice et al., 2011).

The practical choice may therefore depend heavily on whether the researcher wants to:

  • explicitly represent between-person heterogeneity;
  • estimate random-intercept or random-slope variation;
  • predict individual trajectories;
  • use a likelihood-based analysis; or
  • focus primarily on marginal mean effects while treating correlation as a nuisance feature.

Harrell likewise emphasizes that valid longitudinal inference requires explicit attention to within-subject dependence and discusses correlation structures for repeated continuous responses rather than treating observations as independent (Harrell, 2015).

Noncontinuous outcomes: decide what the coefficient should mean

With repeated binary, count, ordinal, or other non-Gaussian outcomes, choosing between a marginal model and a generalized mixed model becomes particularly consequential.

Fitzmaurice et al. summarize the distinction this way: marginal models acknowledge the repeated-measures correlation while targeting population means, whereas generalized linear mixed models explain correlation through common random effects and yield subject-specific fixed-effect interpretations under nonlinear links (Fitzmaurice et al., 2011).

Therefore, for a repeated binary outcome, do not choose GEE merely because “GEE handles binary data,” and do not choose a logistic mixed model merely because “the data are repeated.”

Population-average target

Is the scientific question about population-average probabilities or odds?

Subject-specific target

Is the scientific question about conditional changes for individuals sharing the same modeled random effect?

The method should follow that decision.

Correlation structures are substantive modeling choices

Repeated-measures analysis is not complete once the analyst adds subject = ID.

The pattern of dependence should be considered.

If correlation is plausibly similar across every pair of observations, an exchangeable structure may be reasonable. If observations close together in time should be more similar, an autoregressive-type structure may better reflect the scientific process. An unstructured model is more flexible but requires more covariance parameters.

Harrell recommends using scientific knowledge to guide the choice of correlation structure in longitudinal modeling rather than treating covariance selection as a purely mechanical exercise (Harrell, 2015).

Mixed models require the same level of care. A random intercept alone induces one particular dependence pattern. Adding random slopes changes that pattern. Fitzmaurice et al. note that random intercepts and slopes can represent heterogeneity in variances and correlations as functions of time, but more complex structures may be required in some applications (Fitzmaurice et al., 2011).

A random-effects specification should be scientifically and statistically defensible, not automatically maximal or minimal.

Missing data can change the choice

Missing longitudinal outcomes are one of the most important practical differences between ordinary GEE and likelihood-based mixed modeling.

Standard GEE does not automatically become valid simply because the analyst uses all available rows. In particular, when dropout is related to previously observed outcomes—an important form of MAR—ordinary available-data GEE can yield biased estimates of population mean trends. Likelihood-based longitudinal analyses can provide valid inference under MAR when the joint response model is correctly specified (Fitzmaurice et al., 2011).

This does not make mixed models universally superior. The likelihood-based result depends on assumptions about the response model, including its mean and dependence structure. Nor does MAR mean that missingness can simply be ignored without thought.

For researchers who specifically require a marginal estimand, extensions such as inverse-probability-weighted GEE can address some MAR dropout settings when the observation or dropout model is appropriately specified (Fitzmaurice et al., 2011).

Practical lesson: Do not treat missingness as an afterthought to the GEE-versus-mixed-model decision.

Specify who is missing, when measurements become missing, whether dropout depends on observed outcome history, and what assumptions the chosen estimator requires.

Major assumptions to examine

For GEE

A GEE analysis still requires a defensible marginal mean model: appropriate covariates, functional forms, link function, and interpretation.

The working covariance structure should be chosen thoughtfully, even though the empirical sandwich estimator reduces dependence of inference on perfect specification of that structure.

The number of independent subjects or clusters also matters because sandwich inference is fundamentally large-sample inference; finite-sample performance can be problematic (Fitzmaurice et al., 2011).

Missing-data assumptions must be addressed separately.

For mixed-effects models

Mixed models require specification of both the systematic mean structure and the random-effects/covariance structure.

For generalized linear mixed models, distributional assumptions about random effects are part of the model. Fitzmaurice et al. note that random-effects distributions can be difficult to assess, especially with discrete outcomes, and that predicted random effects themselves should not be treated as straightforward diagnostics of the assumed distribution (Fitzmaurice et al., 2011).

Another important assumption is the relationship between random effects and covariates. Fitzmaurice et al. caution that fixed-effect estimates can be seriously biased when the assumed independence between random effects and covariates fails (Fitzmaurice et al., 2011).

Model convergence, variance estimates near boundaries, residual patterns, and the plausibility of the random-effects structure also require scrutiny.

A practical decision framework

The model choice can be organized as a sequence of methodological decisions rather than a software preference.

1. Choose the scientific target

Start by writing the desired conclusion in words.

If it resembles “On average in the population, how does the outcome differ between groups over time?”, a marginal approach such as GEE may align naturally with the estimand.

If it resembles “How does an individual's outcome change conditional on their subject-specific propensity or trajectory?”, a mixed-effects model may be more aligned, particularly for noncontinuous outcomes.

2. Identify the outcome type

For continuous outcomes, linear mixed models and marginal linear models can have closely related mean interpretations, so covariance modeling, heterogeneity, individual prediction, and missing-data assumptions become important differentiators.

For binary, count, or other noncontinuous outcomes, explicitly distinguish marginal from conditional interpretations before fitting the model.

3. Decide whether individual heterogeneity matters

If random intercepts, random slopes, variance components, or individual trajectory predictions are themselves scientifically useful, a mixed-effects model provides a natural framework.

If those latent subject-specific components are not of interest and the target is the average population response, GEE may provide a more direct model for that target.

4. Examine the dependence pattern

Ask whether correlation appears approximately constant, decreases with time separation, or requires a more flexible representation.

Do not assume that “random intercept” or “exchangeable GEE” is automatically adequate simply because either model converges.

5. Audit missingness

Determine whether incomplete repeated outcomes are plausibly MCAR, MAR conditional on observed information, or potentially MNAR.

Ordinary GEE's robustness to working-correlation misspecification should never be confused with robustness to informative dropout.

6. Interpret the fitted coefficient correctly

For nonlinear repeated-outcome models, never report a GEE coefficient and a generalized mixed-model coefficient as if they estimate the same quantity merely because they use the same outcome and predictors.

The distinction between population averaged vs subject specific is part of the estimand, not merely terminology.

Common mistakes

Common interpretation and model-selection errors
Mistake Why it is incomplete or misleading
“GEE and mixed models do the same thing.” They both address correlated data, but their modeling strategies and, especially with nonlinear links, their regression estimands differ (Fitzmaurice et al., 2011).
“Mixed models give population-average coefficients because fixed effects are population effects.” That statement is too broad. In linear mixed models, averaging over random effects preserves the linear mean. In generalized mixed models with nonlinear links, fixed-effect coefficients generally have conditional or subject-specific interpretations (Fitzmaurice et al., 2011).
“GEE does not care about correlation.” GEE explicitly incorporates a working covariance structure. Misspecification need not destroy consistency of the mean parameter estimator under the relevant conditions, but the working structure can affect efficiency and uncertainty estimation.
“A random intercept solves repeated measures.” A random intercept imposes a particular covariance pattern. Longitudinal heterogeneity may require random slopes or other covariance components.
“Sandwich standard errors make GEE assumption-free.” They do not. The mean model, independent-cluster framework, sufficient large-sample information, and missingness assumptions still matter.
“Mixed models automatically solve missing data.” Likelihood-based mixed models can use incomplete trajectories under appropriate MAR and model assumptions. That is not the same as being immune to informative missingness or model misspecification.
Choosing by outcome type alone Repeated binary data can be modeled with either marginal GEE or generalized mixed models. The desired interpretation should help determine which is appropriate.

Bottom line

The GEE vs mixed effects model decision should begin with the estimand rather than the software menu.

GEE may be the more direct choice when

The scientific target is naturally a marginal or population-average response and correlation primarily needs to be accommodated so that population-level regression effects are estimated appropriately.

A mixed-effects model may be the more direct choice when

Subject-level heterogeneity, random intercepts or slopes, conditional effects, hierarchical variation, or individual trajectories are central to the scientific model.

For continuous linear outcomes, the distinction in mean interpretation may be relatively modest because linear mixed models retain a marginal linear mean. For noncontinuous outcomes using nonlinear links, the distinction between population averaged vs subject specific becomes fundamental.

Neither method is universally superior. The appropriate method is the one whose estimand, dependence model, outcome distribution, missing-data assumptions, and interpretation match the research question.

FAQs

Is GEE better than a mixed-effects model for repeated measures?

No. The methods target different modeling goals. GEE directly models marginal or population-average effects, whereas mixed models explicitly introduce random effects and, with nonlinear links, generally yield subject-specific regression coefficients. Method choice should follow the research question rather than a universal ranking (Fitzmaurice et al., 2011).

What is the main difference between GEE and mixed models?

The clearest difference is how they represent dependence and what their coefficients mean. GEE uses a marginal mean model together with a working covariance structure. Mixed models introduce random effects that generate dependence and represent heterogeneity among individuals. With nonlinear links, this leads to an important population-average versus subject-specific distinction (Fitzmaurice et al., 2011).

Does GEE use random effects?

Standard GEE does not require subject-level random effects. Within-subject dependence is handled through a working covariance or correlation structure rather than by introducing latent random intercepts or slopes (Fitzmaurice et al., 2011; McCulloch & Searle, 2001).

What does population-averaged versus subject-specific mean?

A population-averaged effect describes how the mean response across the population changes with a covariate. A subject-specific effect describes the covariate relationship conditional on the subject-specific components represented in a mixed model. The distinction is especially important for generalized models with nonlinear links (Fitzmaurice et al., 2011).

Can I use GEE for continuous longitudinal data?

Yes. GEE can be applied to continuous repeated outcomes. However, Fitzmaurice et al. note practical limitations of some GEE implementations when longitudinal variances change over time. Linear mixed models and other likelihood-based longitudinal models provide alternative frameworks for continuous outcomes (Fitzmaurice et al., 2011).

Can I use mixed models for binary repeated outcomes?

Yes. Generalized linear mixed models extend mixed-effects modeling to noncontinuous outcomes such as binary responses. Their coefficients under nonlinear links generally have conditional or subject-specific rather than marginal interpretations (Fitzmaurice et al., 2011).

What GEE working correlation should I choose?

The choice should reflect the expected dependence pattern. Exchangeable structures assume similar correlation across pairs, autoregressive structures represent decreasing association with temporal separation, and unstructured forms allow separate pairwise correlations. Scientific knowledge should guide the choice where possible (Fitzmaurice et al., 2011; Harrell, 2015).

Is GEE robust to missing longitudinal data?

Not generally. Robustness to misspecification of the working correlation does not imply robustness to informative dropout. Ordinary GEE can be biased under MAR mechanisms involving previous observed responses; weighted GEE approaches may be needed for some marginal analyses, whereas correctly specified likelihood-based longitudinal models can exploit MAR assumptions differently (Fitzmaurice et al., 2011).

Why can GEE and a logistic mixed model give different coefficients?

Because with a nonlinear link such as the logit, they generally estimate parameters with different interpretations. GEE targets a marginal population-average model, whereas logistic mixed-model fixed effects are conditional on random effects. The numerical coefficients therefore need not agree even when both analyses are appropriately specified for their respective targets (Fitzmaurice et al., 2011).

References

Fitzmaurice, G. M., Laird, N. M., & Ware, J. H. (2011). Applied longitudinal analysis (2nd ed.). Wiley.

Harrell, F. E., Jr. (2015). Regression modeling strategies: With applications to linear models, logistic and ordinal regression, and survival analysis (2nd ed.). Springer.

McCulloch, C. E., & Searle, S. R. (2001). Generalized, linear, and mixed models. Wiley.

Need help with a similar research question?

Share a short, non-confidential summary of your study and the decision you need to make.

Send an enquiry