Introduction
Clinical studies frequently measure the same binary outcome repeatedly over time. Examples include whether a patient is in remission, whether a symptom has resolved, whether a patient experiences an adverse event by a particular visit, or whether a prespecified clinical response has been achieved.
Suppose each patient is assessed at baseline, Week 4, Week 8, and Week 12. At every visit the outcome is either 0 or 1.
The resulting data are longitudinal binary data because the outcome is binary and multiple observations come from the same individual.
The central statistical complication is that observations from the same patient are generally correlated.
A Simple Example
Consider a clinical trial comparing an experimental treatment with placebo. Suppose the endpoint is whether the patient has achieved clinical response at each follow-up visit.
| Patient | Treatment | Week 4 | Week 8 | Week 12 |
|---|---|---|---|---|
| 001 | Active | 0 | 1 | 1 |
| 002 | Active | 1 | 1 | 1 |
| 003 | Active | 0 | 0 | 1 |
| 004 | Placebo | 0 | 0 | 0 |
| 005 | Placebo | 1 | 0 | 0 |
Patient 001 contributes three observations, but those observations should not be treated as if they came from three unrelated patients.
The probability of response at Week 8 for Patient 001 is likely related to their response status at Week 4.
This dependence is the defining feature of the longitudinal problem.
Why Ordinary Logistic Regression Is Not Enough
A standard logistic regression model assumes independent observations.
For an observation \(Y_i\), a conventional logistic model is:
If the same patient contributes multiple observations, however, the independence assumption is violated.
For example, if each of 100 patients contributes four visits, there are 400 observations but only 100 independent subjects.
Three Ways to Think About Longitudinal Binary Data
There are three broad approaches commonly encountered in clinical research:
For genuinely longitudinal inference, GEE and GLMM are the two major modeling frameworks to understand.
The Binary Outcome Model
Let:
- \(Y_{ij}\) = binary outcome for subject \(i\) at visit \(j\)
- \(p_{ij}=P(Y_{ij}=1)\)
- \(X_i\) = treatment indicator
- \(t_j\) = visit or time
- \(X_i t_j\) = treatment-by-time interaction
A common logistic mean model is:
The model can be expanded to include baseline covariates, stratification factors, disease severity, region, or other prespecified prognostic variables.
What Does the Logit Mean?
The logit transformation converts a probability between 0 and 1 into an unbounded scale:
The quantity:
is the odds of response.
Logistic regression models the logarithm of the odds.
Why Time Matters
Longitudinal clinical outcomes frequently change over time.
For example, response might increase as patients receive treatment:
| Visit | Active Response | Placebo Response |
|---|---|---|
| Week 4 | 30% | 20% |
| Week 8 | 50% | 30% |
| Week 12 | 65% | 40% |
The treatment effect is therefore not necessarily constant over time.
This is why a longitudinal model often includes a treatment-by-time interaction.
Treatment-by-Time Interaction
The interaction term is:
It asks whether the treatment effect changes over time.
If the interaction is statistically and clinically important, reporting only one overall treatment odds ratio may hide an important feature of the data.
Generalized Estimating Equations
Generalized estimating equations, or GEE, extend generalized linear models to correlated observations.
The mean model describes the expected response probability, while a working correlation matrix describes the association among repeated observations from the same subject.
The estimating equation can be written conceptually as:
where:
- \(Y_i\) is the vector of repeated outcomes for subject \(i\)
- \(\mu_i\) is the corresponding vector of fitted means
- \(D_i\) contains derivatives of the mean with respect to the model parameters
- \(V_i\) is the working covariance matrix
The important practical point is that GEE accounts for the repeated nature of the observations when estimating the regression parameters and their uncertainty.
Population-Averaged Interpretation
GEE produces a population-averaged, or marginal, interpretation.
Suppose the treatment coefficient is \(\beta_1\).
The corresponding odds ratio is:
The interpretation is approximately: the ratio of the odds of response for treated versus control subjects at the population level, conditional on the variables included in the model.
This is particularly attractive when the scientific question concerns the average treatment effect across the target population.
Generalized Linear Mixed Models
A generalized linear mixed model, or GLMM, handles within-subject correlation by introducing random effects.
For example, a random-intercept logistic model is:
where:
The random intercept \(b_i\) allows different patients to have different underlying propensities for response.
Why Random Intercepts Make Sense
Consider two patients receiving exactly the same treatment.
One patient may have a generally high probability of responding, while another may have a much lower probability.
A random intercept allows the model to represent this patient-to-patient heterogeneity.
The model therefore recognizes that repeated observations from the same patient are related because they share the same underlying patient-specific random effect.
Random Slopes
A more flexible GLMM can allow patients to have different trajectories over time:
Here:
- \(b_{0i}\) is the subject-specific random intercept.
- \(b_{1i}\) is the subject-specific random time effect.
This allows patients to differ both in their baseline propensity for response and in how their response probability changes over time.
GEE vs. GLMM
| Feature | GEE | GLMM |
|---|---|---|
| Primary interpretation | Population-averaged | Subject-specific |
| Correlation handled by | Working correlation | Random effects |
| Patient-specific heterogeneity | Not explicitly modeled | Yes |
| Random effects | No | Yes |
| Typical odds ratio | Marginal OR | Conditional OR |
| Missing data considerations | Usually requires MAR-type assumptions for standard inference | Likelihood-based methods can accommodate MAR under model assumptions |
| Clinical-trial population interpretation | Often straightforward | More patient-specific |
Why GEE and GLMM Odds Ratios Differ
An important feature of nonlinear models is that marginal and conditional effects are generally not numerically identical.
Suppose a GLMM estimates a conditional odds ratio of 3.0.
A corresponding GEE analysis might estimate a marginal odds ratio of 2.4.
This does not necessarily mean that one model is wrong.
The models are answering different questions.
Working Correlation Structures in GEE
GEE requires a working correlation structure.
Common choices include:
| Structure | Assumption |
|---|---|
| Independent | Repeated measurements treated as uncorrelated for the working covariance |
| Exchangeable | All pairs of observations from the same subject have the same correlation |
| AR(1) | Correlation decreases as visits become farther apart |
| Unstructured | Each pairwise correlation is estimated separately |
Exchangeable Correlation
Under exchangeable correlation:
Every pair of visits within the same subject has the same correlation.
This can be reasonable when the visits are relatively similar in spacing and there is no strong reason to expect correlation to decline with time.
AR(1) Correlation
An AR(1) structure assumes that observations closer together in time are more strongly correlated.
For example, if \(\rho=0.70\):
| Visit Separation | Correlation |
|---|---|
| 1 visit apart | 0.70 |
| 2 visits apart | 0.49 |
| 3 visits apart | 0.34 |
AR(1) is often appealing for regularly spaced longitudinal assessments.
Unstructured Correlation
An unstructured working correlation matrix places no simple restrictions on the pairwise correlations.
For four visits:
This is flexible but requires many correlation parameters.
Does the GEE Working Correlation Have to Be Correct?
One of the major attractions of GEE is that inference can remain valid under a misspecified working correlation when an appropriate sandwich, or robust, variance estimator is used, under the usual regularity conditions.
The working correlation therefore does not have exactly the same role as a fully specified likelihood covariance model.
A useful distinction is:
Small-Sample GEE Considerations
The large-sample properties of GEE are important.
With a small number of independent subjects, however, the ordinary sandwich variance estimator can be biased downward or otherwise provide poor finite-sample inference.
This is especially important in clinical trials with relatively few randomized subjects but multiple repeated observations.
Potential approaches include:
- Finite-sample corrections to the sandwich estimator
- Small-sample-adjusted Wald tests
- Alternative inferential procedures when justified
- Likelihood-based GLMM approaches
Choosing GEE or GLMM
The choice should begin with the scientific estimand rather than the software procedure.
| Scientific Question | Potentially Appropriate Approach |
|---|---|
| What is the average treatment effect in the target population? | GEE / marginal model |
| How does treatment affect an individual subject conditional on latent patient characteristics? | GLMM |
| Is patient-level heterogeneity itself scientifically important? | GLMM |
| Is the primary estimand population-level? | GEE is often attractive |
| Is subject-specific prediction important? | GLMM is often attractive |
A Clinical Trial Example
Suppose a randomized clinical trial compares an active treatment with placebo.
The binary endpoint is: clinical response = 1 if the patient meets the prespecified response criterion at the visit; 0 otherwise.
Patients are assessed at Weeks 4, 8, and 12.
The analysis objective is to compare treatment groups over the follow-up period while accounting for repeated measurements.
Example Data Structure
| USUBJID | Treatment | Week | Response |
|---|---|---|---|
| 001 | Active | 4 | 0 |
| 001 | Active | 8 | 1 |
| 001 | Active | 12 | 1 |
| 002 | Active | 4 | 1 |
| 002 | Active | 8 | 1 |
| 002 | Active | 12 | 0 |
| 003 | Placebo | 4 | 0 |
| 003 | Placebo | 8 | 0 |
| 003 | Placebo | 12 | 1 |
The data should generally be represented in long format for GEE and GLMM analyses.
Why Long Format Is Important
In long format, each row corresponds to one subject-visit combination.
For subject \(i\) with three visits, there are three rows.
This allows the statistical software to identify:
- Which observations belong to the same subject
- Which visit each observation represents
- Which treatment the subject received
- Which observations are missing
Model Specification
A typical model might be:
If visit is categorical, the model allows a separate treatment comparison at each post-baseline visit.
Categorical vs. Continuous Time
Time can be represented as a categorical factor or as a continuous variable.
Categorical Visit
If the model includes separate indicators for Weeks 8 and 12 relative to Week 4, it does not assume a linear time trend.
This is often appropriate when clinical response trajectories may be nonlinear.
Continuous Time
A continuous time variable imposes a functional form on the trajectory.
For example:
This is parsimonious but assumes a linear relationship on the log-odds scale.
Reference Categories Matter
Suppose Week 4 is the reference visit and placebo is the reference treatment.
Then:
- The treatment coefficient compares active treatment with placebo at Week 4.
- The Week 8 coefficient describes change from Week 4 within placebo.
- The treatment-by-Week 8 interaction describes the additional active-versus-placebo difference at Week 8.
The same logic applies at Week 12.
Interpreting an Interaction Model
Suppose the estimated coefficients are:
| Parameter | Estimate |
|---|---|
| Treatment | 0.40 |
| Week 8 | 0.55 |
| Week 12 | 0.80 |
| Treatment × Week 8 | 0.30 |
| Treatment × Week 12 | 0.65 |
The Week 12 treatment effect on the log-odds scale is:
Therefore the corresponding odds ratio is:
Thus, at Week 12, the estimated odds of response are approximately 2.86 times as high for active treatment as for placebo, under the relevant interpretation of the model.
Do Not Interpret the Interaction Alone as the Treatment Effect
A common mistake is to report the treatment-by-time interaction coefficient as if it were the complete treatment effect at that visit.
With treatment and interaction terms in the model, the treatment effect at a particular visit is determined by the relevant combination of coefficients.
For example:
This should then be exponentiated when reporting an odds ratio.
From Odds Ratios to Probabilities
Odds ratios can be difficult to interpret clinically.
Therefore, model-based predicted probabilities are often valuable.
For a logistic model:
where \(\eta\) is the linear predictor.
For example, if:
then:
or approximately 67.9%.
Risk Difference, Risk Ratio, and Odds Ratio
Binary longitudinal outcomes can be summarized using several effect measures.
| Measure | Definition |
|---|---|
| Risk difference | \(p_T-p_C\) |
| Risk ratio | \(p_T/p_C\) |
| Odds ratio | \([p_T/(1-p_T)]/[p_C/(1-p_C)]\) |
The logistic link naturally produces odds ratios.
If risk differences or risk ratios are the primary estimand, alternative marginal models and link functions may be more appropriate.
GEE With a Logit Link
A standard GEE specification for a binary outcome uses:
which leads to odds-ratio interpretations.
Other links are possible.
| Link | Common Interpretation |
|---|---|
| Logit | Odds ratio |
| Log | Risk ratio under appropriate model specification |
| Identity | Risk difference |
The identity and log links can present numerical or convergence challenges when probabilities approach the boundaries of 0 and 1.
Missing Longitudinal Binary Outcomes
Missing data are especially important in longitudinal clinical trials.
A patient may have:
- A Week 4 response
- A missing Week 8 response
- A Week 12 response
or may discontinue treatment and contribute no later assessments.
The missing-data mechanism therefore becomes part of the analysis strategy.
MCAR, MAR, and MNAR
| Mechanism | Meaning |
|---|---|
| MCAR | Missing completely at random |
| MAR | Missingness may depend on observed information |
| MNAR | Missingness may depend on unobserved information |
The distinction is fundamental because different methods require different assumptions.
GEE and Missing Data
Standard GEE analyses with commonly used estimating procedures generally rely on assumptions concerning the missingness process.
Under appropriate conditions, GEE can provide valid inference under missing-at-random-type mechanisms when the mean model and missingness-related assumptions are appropriately specified.
However, simply stating that "GEE handles missing data" is incorrect.
GLMM and Missing Data
Likelihood-based GLMM analyses can use all available repeated observations under the model assumptions.
This is one reason GLMMs are frequently considered for longitudinal clinical trial analyses with incomplete follow-up.
Under a MAR framework, likelihood-based estimation can provide valid inference without requiring ad hoc last-observation-carried-forward imputation.
However, the validity still depends on the model and missing-data assumptions.
Why LOCF Is Usually Problematic
Last observation carried forward, or LOCF, replaces a missing future observation with the patient's last observed value.
For longitudinal binary outcomes this can be particularly unrealistic.
A patient who responded at Week 4 but discontinued treatment before Week 12 is not necessarily still a responder at Week 12.
LOCF can therefore introduce bias and distort uncertainty.
Intermittent vs. Monotone Missingness
Two important patterns are:
- Intermittent missingness: a patient misses one visit but returns later.
- Monotone dropout: once observations stop, all subsequent observations are missing.
Longitudinal likelihood-based methods can often use all available information without requiring a complete data set.
Subject-Level Correlation
Why are repeated binary outcomes correlated?
Consider a patient's latent disease severity.
A patient who is likely to respond at Week 4 may also be more likely to respond at Week 8 and Week 12.
This induces positive within-subject correlation.
The correlation can be represented conceptually as:
and similarly for other pairs of visits.
Correlation Is Not the Treatment Effect
A common conceptual mistake is to interpret the estimated correlation as a clinical treatment effect.
The correlation describes the dependence among repeated observations within subjects.
The treatment coefficient describes the association between treatment and the binary outcome after accounting for the model structure.
GEE Implementation in R
The geepack package provides a commonly used
implementation of GEE in R.
library(geepack) fit_gee <- geeglm( response ~ treatment * visit, id = usubjid, data = dat, family = binomial(link = "logit"), corstr = "exchangeable" ) summary(fit_gee)
Here:
responseis the binary endpoint.treatmentidentifies the randomized treatment.visitrepresents the repeated assessment.ididentifies the patient.corstrspecifies the working correlation structure.
GEE With AR(1)
fit_gee_ar1 <- geeglm( response ~ treatment * visit, id = usubjid, data = dat, family = binomial(link = "logit"), corstr = "ar1" ) summary(fit_gee_ar1)
An AR(1) structure can be considered when observations close together in time are expected to be more strongly correlated.
Extracting Odds Ratios in R
beta <- coef(fit_gee) OR <- exp(beta) OR
Confidence intervals can be obtained from the estimated coefficients and their standard errors.
se <- sqrt(diag(vcov(fit_gee))) lower <- exp(beta - 1.96 * se) upper <- exp(beta + 1.96 * se) results <- data.frame( estimate = beta, OR = OR, lower = lower, upper = upper ) results
GLMM Implementation in R
A logistic GLMM can be fitted using the lme4 package.
library(lme4) fit_glmm <- glmer( response ~ treatment * visit + (1 | usubjid), data = dat, family = binomial(link = "logit") ) summary(fit_glmm)
The expression:
(1 | usubjid)
specifies a subject-specific random intercept.
Random-Slope GLMM in R
fit_glmm_slope <- glmer(
response ~ treatment * visit +
(1 + visit | usubjid),
data = dat,
family = binomial(link = "logit")
)
summary(fit_glmm_slope)
This allows both the intercept and the effect of time to vary across patients.
For categorical visit, random slopes can become parameter-heavy. A random-intercept model is often a more stable starting point.
GEE Implementation in SAS
In SAS, PROC GENMOD can be used for GEE models.
proc genmod data=analysis descending;
class usubjid treatment visit;
model response =
treatment
visit
treatment*visit
/ dist=binomial
link=logit;
repeated subject=usubjid
/ type=exch
corrw
empirical;
run;
The repeated statement identifies the repeated
observations within subject.
SAS With AR(1)
proc genmod data=analysis descending;
class usubjid treatment visit;
model response =
treatment
visit
treatment*visit
/ dist=binomial
link=logit;
repeated subject=usubjid
/ type=ar(1)
empirical;
run;
The empirical option requests the robust
sandwich covariance estimator.
GLMM Implementation in SAS
A logistic GLMM can be fitted using PROC GLIMMIX.
proc glimmix data=analysis;
class usubjid treatment visit;
model response(event='1') =
treatment
visit
treatment*visit
/ dist=binomial
link=logit
solution
oddsratio;
random intercept / subject=usubjid;
run;
The random intercept accounts for subject-level heterogeneity.
Random Slopes in SAS
proc glimmix data=analysis;
class usubjid treatment visit;
model response(event='1') =
treatment
visit
treatment*visit
/ dist=binomial
link=logit
solution
oddsratio;
random intercept visit
/ subject=usubjid
type=un;
run;
The unstructured random-effects covariance allows the random intercept and random time effect to be correlated.
Comparing Working Correlation Structures
When fitting GEE models, investigators may compare plausible working correlation structures.
| Candidate | When It May Be Reasonable |
|---|---|
| Independent | Within-subject correlation is weak or used as a robustness specification |
| Exchangeable | Repeated visits have broadly similar correlations |
| AR(1) | Correlation is expected to decline with time separation |
| Unstructured | Few visits and sufficient sample size to estimate correlations reliably |
Correlation selection should be based on the study design, clinical timing, scientific knowledge, and model diagnostics rather than simply selecting the structure that produces the most favorable treatment p-value.
QIC and GEE Model Comparison
The quasi-likelihood under the independence model criterion, commonly called QIC, can be used when comparing GEE specifications.
Conceptually, QIC plays a role analogous to information criteria used in likelihood-based modeling, although the interpretation is not identical.
A smaller QIC can support a preferred working correlation structure among candidate models, but clinical and statistical considerations should also be taken into account.
What Happens If the Correlation Is Ignored?
Suppose four repeated observations per subject are treated as independent.
The analysis may behave as though there are four times as much independent information as actually exists.
This can lead to standard errors that are too small and confidence intervals that are too narrow.
Consequently, statistical significance can be overstated.
Binary Outcomes Are Different From Continuous Outcomes
For continuous longitudinal outcomes, linear mixed models are often natural.
For binary outcomes, the response distribution is Bernoulli or binomial and the relationship between covariates and the mean is nonlinear.
Therefore, a standard linear mixed model is generally inappropriate for a binary endpoint.
| Outcome | Common Longitudinal Model |
|---|---|
| Continuous | Linear mixed model / MMRM |
| Binary | GEE / logistic GLMM |
| Count | Poisson or negative-binomial GEE / GLMM |
| Ordinal | Ordinal GEE / cumulative-link mixed model |
Binary Response vs. Repeated Binary Event
The meaning of the binary endpoint must be defined carefully.
"Response at Week 12" is different from "ever experienced an adverse event."
A longitudinal binary response can represent a patient's status at each visit.
An adverse-event indicator may instead represent whether an event has occurred by a particular time.
The analysis should therefore match the clinical definition of the endpoint.
Monotone Response Processes Require Care
Some binary outcomes are inherently persistent.
For example, once a patient experiences a particular event, the status may remain 1 at all subsequent visits.
In such situations, the repeated observations may have a very different dependence structure from a repeatedly assessed reversible response.
Responder Analysis at a Single Visit
A study may specify Week 12 response as the primary endpoint.
In that case, a primary analysis could compare treatment groups at Week 12 using an appropriate binary-outcome model.
Earlier response measurements may then serve as supportive longitudinal information rather than being incorporated into the primary estimand.
This can be appropriate when the clinical question is specifically: What is the treatment effect on response at Week 12?
Longitudinal Estimand vs. Single-Visit Estimand
| Question | Example Estimand |
|---|---|
| Single time point | Treatment effect on response at Week 12 |
| Repeated trajectory | Treatment effect across Weeks 4, 8, and 12 |
| Average effect | Population-average treatment effect over follow-up |
| Subject-specific effect | Treatment effect conditional on patient-specific random effects |
The model should follow the estimand.
A Worked Numerical Example
Suppose a trial has 200 patients, 100 randomized to active treatment and 100 to placebo.
The observed response rates are:
| Visit | Active | Placebo |
|---|---|---|
| Week 4 | 35% | 25% |
| Week 8 | 52% | 34% |
| Week 12 | 64% | 42% |
The response rate difference appears to increase over time.
This suggests that a treatment-by-time interaction may be clinically relevant.
Approximate Week 12 Odds Ratio
At Week 12:
The active-treatment odds are:
The placebo odds are:
Therefore the crude Week 12 odds ratio is approximately:
A longitudinal model can provide an adjusted estimate while accounting for the repeated observations.
Why the Crude and Model-Based OR May Differ
The model may adjust for:
- Baseline covariates
- Other visits
- Treatment-by-time interactions
- Within-subject correlation
- Model-specific random effects
Therefore, the longitudinal model's estimate should not be expected to equal the crude cross-sectional odds ratio.
Predicted Probabilities Are Often More Intuitive
Suppose the fitted model estimates:
| Visit | Adjusted Active Probability | Adjusted Placebo Probability |
|---|---|---|
| Week 4 | 34% | 26% |
| Week 8 | 51% | 35% |
| Week 12 | 63% | 43% |
The corresponding Week 12 risk difference is:
or 20 percentage points.
This may be more clinically intuitive than an odds ratio alone.
Confidence Intervals
For a logistic coefficient \(\hat{\beta}\) with standard error \(SE(\hat{\beta})\), a Wald confidence interval on the log-odds scale is:
Exponentiating gives the corresponding odds-ratio confidence interval:
where \(L\) and \(U\) are the lower and upper limits on the log-odds scale.
Testing the Treatment-by-Time Interaction
Suppose there are three visits and two treatment-by-time interaction parameters.
The joint hypothesis might be:
A joint test evaluates whether the treatment effect is consistent across visits.
If the interaction is not important, a simpler model may estimate an overall treatment effect across the repeated assessments, depending on the prespecified estimand.
Don't Automatically Remove the Interaction
A nonsignificant interaction does not automatically prove that treatment effects are identical at every time point.
The decision should consider:
- Clinical plausibility
- Effect estimates and confidence intervals
- Study design
- Prespecified estimand
- Power for detecting interaction
Interaction tests can have substantially less power than the main treatment comparison.
Baseline Binary Measurements
Some longitudinal studies also measure the binary outcome at baseline.
Whether baseline is included in the repeated outcome model depends on the estimand, study design, and analysis strategy.
In randomized trials, baseline adjustment can improve precision when handled appropriately.
However, baseline response status may require special treatment if it is structurally different from post-baseline response.
Covariate Adjustment
A longitudinal binary model can include baseline covariates such as:
- Age
- Sex
- Baseline disease severity
- Prior treatment
- Geographic region
- Stratification factors
A general model is:
where \(\mathbf{Z}_i\) contains baseline covariates.
Clinical Trial Stratification Factors
If randomization was stratified by a factor such as disease severity or region, the primary analysis should generally respect the prespecified randomization and analysis strategy.
Ignoring important stratification factors can reduce efficiency or produce an analysis inconsistent with the trial's planned inferential framework.
Multiplicity Across Visits
Longitudinal analyses can generate several treatment comparisons:
- Active vs. placebo at Week 4
- Active vs. placebo at Week 8
- Active vs. placebo at Week 12
If all three are used to support a confirmatory claim, multiplicity may need to be addressed.
A longitudinal model does not automatically eliminate multiplicity.
Model-Based Least-Squares Means
In clinical reporting, investigators may want adjusted probabilities by treatment and visit.
These can be obtained from model-based marginal means or estimated marginal means.
The resulting table might look like:
| Visit | Active | Placebo | Risk Difference |
|---|---|---|---|
| Week 4 | 34% | 26% | 8% |
| Week 8 | 51% | 35% | 16% |
| Week 12 | 63% | 43% | 20% |
Such summaries can make a technically complex longitudinal model much easier for clinicians to interpret.
Model Diagnostics
Binary longitudinal models require different diagnostics from ordinary linear regression.
Useful checks include:
- Convergence
- Boundary estimates
- Estimated correlation parameters
- Random-effect variance estimates
- Influential subjects
- Predicted probabilities
- Observed versus predicted response patterns
- Sensitivity to covariance structure
Convergence Problems in GLMMs
GLMMs can encounter convergence problems, especially with:
- Small sample sizes
- Sparse binary outcomes
- Rare events
- Many random-effect parameters
- Strong separation
- Highly correlated random effects
A convergence warning should not simply be ignored.
Complete Separation
Logistic models can experience separation when a predictor perfectly predicts the binary outcome.
For example, if every patient receiving a treatment responds and nobody in placebo responds at a particular visit, the corresponding logistic coefficient may become extremely large.
This can cause estimation difficulties in both ordinary logistic regression and more complicated longitudinal models.
Rare Binary Outcomes
If the outcome is rare, standard asymptotic methods can become less reliable, particularly when the number of subjects is small.
Investigators should consider:
- Event frequency
- Number of independent subjects
- Model complexity
- Separation
- Finite-sample inference
Rare outcomes may require specialized methods depending on the study objective.
GEE and GLMM Sensitivity Analysis
For an important clinical-trial analysis, it can be useful to examine whether the treatment conclusion is robust across reasonable modeling approaches.
For example:
| Analysis | Purpose |
|---|---|
| Primary GEE | Population-averaged treatment effect |
| Alternative GEE correlation | Assess sensitivity to working correlation |
| Logistic GLMM | Assess subject-specific interpretation |
| Multiple imputation | Assess missing-data sensitivity |
| Pattern-mixture / MNAR sensitivity analysis | Assess departures from MAR assumptions |
What Should the Primary Analysis Be?
There is no universal answer.
If the estimand is explicitly population-averaged, GEE may be a natural primary framework.
If patient-specific heterogeneity is scientifically important, a GLMM may be more appropriate.
The choice should be specified before unblinding treatment-group outcome data.
Common Mistakes
- Using ordinary logistic regression on stacked repeated observations. This ignores the within-subject dependence unless an appropriate variance strategy is used.
- Assuming GEE and GLMM estimate the same odds ratio. Marginal and conditional effects generally differ for nonlinear models.
- Choosing a covariance structure based on the treatment p-value. Correlation structure should be justified independently of treatment significance.
- Ignoring missing-data assumptions. Neither GEE nor GLMM makes missing data automatically harmless.
- Reporting only odds ratios. Adjusted response probabilities and risk differences can often be more clinically interpretable.
- Ignoring treatment-by-time interaction. A treatment effect can change substantially over follow-up.
- Overfitting random effects. Random slopes and complex covariance structures require sufficient information.
- Including baseline mechanically. Baseline should be handled according to the estimand and prespecified analysis.
- Ignoring multiplicity. Multiple visit-specific treatment comparisons may create multiplicity concerns.
- Ignoring convergence warnings. A model that has not converged should not automatically be treated as valid.
A Practical Analysis Workflow
What Should Be Reported in the Statistical Analysis Plan?
A longitudinal binary analysis should be sufficiently prespecified that another statistician could reproduce the primary analysis.
The SAP should generally describe:
- Primary binary endpoint
- Assessment visits
- Analysis population
- Estimand
- Treatment effect measure
- Link function
- Mean model
- Visit parameterization
- Treatment-by-time interaction
- Correlation structure for GEE or random-effects structure for GLMM
- Variance estimator
- Covariate adjustment
- Missing-data assumptions
- Multiplicity strategy
- Confidence interval methodology
- Sensitivity analyses
Example SAP Language
A population-averaged analysis might be described conceptually as:
A GLMM-based analysis would instead explicitly specify the random-effects structure.
Interpreting a GEE Result
Suppose the primary GEE analysis estimates:
Then:
A population-averaged interpretation is: the estimated odds of response are approximately twice as high in the active-treatment group as in the placebo group, under the specified marginal model.
The exact interpretation depends on the reference visit and whether a treatment-by-time interaction is included.
Interpreting a GLMM Result
Suppose a logistic GLMM estimates:
Then:
This represents a subject-specific odds ratio under the conditional model.
It should not automatically be described as a population-average odds ratio.
GEE Robustness to Correlation Misspecification
Suppose the true correlation is AR(1), but an exchangeable working correlation is used.
With appropriate robust variance estimation, the GEE regression coefficient can remain consistently estimated under standard conditions even if the working correlation is not exactly correct.
However, the efficiency of estimation can change.
Therefore, choosing a reasonable working correlation remains useful even though the robust variance provides protection against certain forms of misspecification.
When Independence GEE Can Be Useful
An independence working correlation may seem strange for longitudinal data.
It can nevertheless be useful as a sensitivity analysis or when the primary scientific inference is robust to the correlation specification.
With robust variance estimation, the mean-model coefficient can remain valid under appropriate conditions even when the working independence structure does not reflect the actual within-subject correlation.
Marginal vs. Conditional: A Conceptual Example
Imagine that patients vary substantially in their baseline propensity to respond.
A patient-specific treatment effect may be large after conditioning on their latent propensity.
When averaging over heterogeneous patients, the population-level effect can be attenuated.
This is one reason a conditional GLMM odds ratio can be farther from 1 than a marginal GEE odds ratio.
Model-Based Predictions
For a fitted logistic model, predictions can be generated for each treatment and visit combination.
newdat <- expand.grid(
treatment = c("Placebo", "Active"),
visit = c("Week 4", "Week 8", "Week 12")
)
newdat$predicted <- predict(
fit_gee,
newdata = newdat,
type = "response"
)
newdat
For GLMMs, predictions require attention to whether the desired predictions are conditional on random effects or marginal over the random-effects distribution.
Conditional vs. Population-Level Predictions
This distinction is especially important with GLMMs.
A prediction conditional on a subject-specific random effect answers a different question from a prediction averaged over the population distribution of random effects.
When reporting clinical treatment probabilities, the desired prediction scale should be specified explicitly.
Model Validation and Sensitivity
A strong longitudinal analysis should not end with the primary model fit.
Useful sensitivity analyses may include:
- Alternative GEE working correlations
- GEE versus GLMM
- Alternative visit parameterizations
- Alternative missing-data assumptions
- Adjusted versus unadjusted models
- Alternative treatment-by-time specifications
The purpose is not to search for the most favorable result.
The purpose is to determine whether the scientific conclusion is robust to reasonable analytical assumptions.
A Compact Decision Tree
Yes → consider a longitudinal binary model.
Consider → GEE.
Consider → GLMM.
Consider → treatment-by-visit interaction.
Yes → explicitly address the missing-data assumptions.
Key Differences Between GEE and GLMM
| Question | GEE | GLMM |
|---|---|---|
| What is modeled? | Population mean | Conditional subject-specific mean |
| Correlation mechanism | Working correlation | Random effects |
| Typical effect | Marginal OR | Conditional OR |
| Subject-specific inference | Limited | Natural |
| Robust variance | Central feature | Not the defining feature |
| Likelihood | Quasi-likelihood / estimating equations | Likelihood-based |
| Prediction of subject heterogeneity | Not the primary goal | Major strength |
What About Generalized Estimating Equations With Exchangeable Correlation?
A very common clinical-trial specification is:
with an exchangeable working correlation.
This can be a useful and interpretable population-averaged model when the scientific objective concerns average treatment response over scheduled visits.
What About GLMM With a Random Intercept?
A common GLMM is:
This is often a reasonable starting model because it captures persistent subject-level differences without requiring a large number of random-effects parameters.
Which Is Better?
Neither method is universally better.
The question should instead be: Which model corresponds to the scientific estimand and assumptions of the study?
A GEE can be preferable for a population-level treatment question.
A GLMM can be preferable when subject-level heterogeneity is central.
In some studies, both can be useful as complementary analyses.
What to Put in a Clinical Study Report
A clinical study report should clearly identify:
- The binary endpoint
- All scheduled assessment visits
- The primary analysis population
- The estimand
- The longitudinal model
- The link function
- The treatment and visit terms
- The interaction specification
- The working correlation or random-effects structure
- The variance estimator
- The missing-data assumptions
- The estimated treatment effects
- Confidence intervals
- Adjusted response probabilities where useful
- Sensitivity analyses
Example Results Table
| Visit | Active Response | Placebo Response | Adjusted OR | 95% CI |
|---|---|---|---|---|
| Week 4 | 34% | 26% | 1.47 | 1.02–2.13 |
| Week 8 | 51% | 35% | 1.92 | 1.31–2.81 |
| Week 12 | 63% | 43% | 2.26 | 1.52–3.37 |
A table like this is generally more useful to clinical readers than reporting only a single regression coefficient.
Important Distinction: Repeated Binary Outcomes vs. Binary Repeated Events
A repeated binary status and a recurrent-event process are not interchangeable.
For example:
- "Patient is in remission at Week 12" is a binary longitudinal status.
- "Patient experienced three disease flares during follow-up" is a recurrent event count.
- "Time until first flare" is a time-to-event endpoint.
Each requires a different statistical framework.
When a Survival Model May Be Better
If the clinical question is primarily: How long until the patient first achieves response? then a survival-analysis framework may be more appropriate than repeated binary logistic modeling.
Similarly, if the question is: How long until loss of response? a time-to-event model may better represent the endpoint.
Longitudinal Binary Analysis Checklist
| Question | Check |
|---|---|
| Is the endpoint truly binary? | Yes / No |
| Are observations repeated within subject? | Yes / No |
| What is the estimand? | Population / subject-specific / other |
| Is visit categorical? | Prespecify |
| Is treatment-by-time interaction required? | Prespecify |
| GEE or GLMM? | Based on estimand |
| Correlation structure? | Prespecify |
| Missing-data assumptions? | Prespecify |
| Multiplicity? | Assess |
| Clinical interpretation? | Include probabilities and/or risk differences where appropriate |
The Most Important Concept
The central issue in longitudinal binary analysis is not simply that the outcome is binary.
It is the combination of:
- A binary response distribution
- Repeated observations within the same patient
- Potentially changing treatment effects over time
- Within-subject correlation
- Incomplete follow-up
- A specific scientific estimand
GEE and GLMM solve the correlation problem in different ways.
GEE focuses on the population-average mean response and uses a working correlation plus robust inference.
GLMMs introduce subject-specific random effects and provide conditional interpretations.
References
Liang, K.-Y. & Zeger, S.L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73(1), 13–22.
Zeger, S.L., Liang, K.-Y. & Albert, P.S. (1988). Models for longitudinal data: a generalized estimating equation
approach. Biometrics, 44(4), 1049–1060.
Diggle, P., Heagerty, P., Liang, K.-Y. & Zeger, S. (2002). Analysis of Longitudinal Data. 2nd ed. Oxford University Press.
Fitzmaurice, G.M., Laird, N.M. & Ware, J.H. (2011). Applied Longitudinal Analysis. 2nd ed. Wiley.
Hedeker, D. & Gibbons, R.D. (2006). Longitudinal Data Analysis. Wiley.
McCulloch, C.E., Searle, S.R. & Neuhaus, J.M. (2008). Generalized, Linear, and Mixed Models. 2nd ed. Wiley.
Hardin, J.W. & Hilbe, J.M. (2013). Generalized Estimating Equations. 2nd ed. Chapman & Hall/CRC.
Fitzmaurice, G., Davidian, M., Verbeke, G. & Molenberghs, G., eds. (2008). Longitudinal Data Analysis. Chapman & Hall/CRC.