Statistics Glossary → Generalized Estimating Equations (GEE)
Generalized Estimating Equations (GEE)analysis
A method for dependent data, such as repeated measurements on the same person or observations within the same cluster, that estimates population-averaged regression coefficients for continuous, binary or count outcomes with standard errors that are robust to the dependence.
Concept
A patient's measurements at four visits, or the responses of members of the same family, are not independent of one another. If this dependence is ignored, standard errors are wrong and significance is often overstated. Generalised estimating equations (GEE) extend generalised linear models such as logistic or Poisson regression to such clustered data.
GEE has two parts. The mean model links the expected value of the outcome to the predictors through a link function (e.g. the logit for a binary outcome). The working correlation matrix is an assumption about how measurements within a cluster resemble one another: all pairs equally correlated (exchangeable), consecutive measurements more strongly correlated (AR(1)) or completely free (unstructured). Standard errors are computed with a sandwich (robust) estimator built from cluster sums; hence, even if the working correlation is misspecified, the coefficients and standard errors remain consistent given enough clusters, and a correct choice only improves efficiency.
GEE coefficients are population-averaged (marginal) effects: they answer 'how different are the odds of improvement across treated patients as a whole?'. Mixed models (GLMM) give subject-specific (conditional) effects instead; for binary and count outcomes the two kinds of coefficient differ numerically. Because GEE is not likelihood-based, QIC is used instead of AIC. With few clusters (e.g. fewer than 40), sandwich standard errors may be too small and a small-sample correction is needed. With missing data, the results are more sensitive than mixed models to the assumption that missingness is completely at random.
When to use it
- With repeated-measures or clustered data, when interest lies in population-level average effects (e.g. the average effect of a public health intervention in a community) and the outcome is binary, a count or continuous.
- If subject- or cluster-specific effects, the variance of random effects or individual-level predictions are wanted, use a linear mixed model (LMM) or a generalised linear mixed model (GLMM).
- If the observations are truly independent, ordinary logistic, Poisson or linear regression is sufficient; with very few clusters, models treating the clusters as fixed effects can be considered instead of GEE.
An everyday example
In an asthma study, 120 children receive a new inhaler or a placebo, and at each of four check-up visits it is recorded whether the child had an attack-free week (yes/no). A child's visits resemble one another: a child who is well at one visit tends to be well at the next. GEE accounts for this similarity through the working correlation and might give OR = 2.5 for the inhaler: across children on the inhaler, the odds of an attack-free week are about 2.5 times those of children on placebo.
Parameters in MerQur
Independent variables, Dependent variable (DV), Group (cluster) variable
Concept: The dependent variable and predictors define the mean model, while the cluster variable states within which unit dependent observations are grouped. Clusters are treated as independent; because robust standard errors rest on the number of clusters, the cluster definition directly determines the standard errors.
Everyday example: In the asthma example the dependent variable is an attack-free week (1/0), the predictors are treatment, age and baseline status, and the cluster is the child. If two hospitals used the same patient numbers, the cluster must be defined by 'hospital + number'; otherwise two different children would be treated as one cluster.
What it does: Sets y, the predictors of the mean model and the units treated as independent (clusters). Because the sandwich SE is built from cluster sums, the cluster definition is the SE itself.
Effect on the result: Determines all output.
On the validation data: In respiratory the patient ID repeats in two centres, so the cluster was derived from centre and ID combined (cid). Text predictors become dummies with the first level left out.
Family (Gaussian (continuous) / Binomial (binary) / Poisson (count) / Gamma (positive continuous) / Negative binomial (k = 1))
Concept: Depending on the type of outcome, determines how the variance relates to the mean and on what scale the coefficients are interpreted: Gaussian for continuous outcomes, binomial for binary, Poisson or negative binomial for counts, Gamma for positive, right-skewed measurements.
Everyday example: Because an attack-free week is yes/no, the binomial family is chosen and the coefficients are converted to odds ratios. If the outcome were 'number of attacks per week', Poisson or negative binomial would be chosen and the coefficients read as rate ratios (IRR).
What it does: Sets the variance function and canonical link. For binomial, Poisson and negative binomial the scale φ = 1 is fixed; for Gaussian and Gamma φ = Σr²/(N - p).
Effect on the result: Changes the coefficient scale (log-odds, log-rate, mean), the OR/IRR table and the model-based SE.
On the validation data: dietox Time coefficient Gaussian 6.9425 (SE 0.0796), Gamma canonical -0.0019, Gamma-log 0.1244. In epilepsy the Poisson and negative binomial trt_time coefficients are the same (-0.1047).
Correlation structure (Exchangeable (compound symmetry) / Independence / AR(1) - Autoregressive / Unstructured / M-dependent (stationary))
Concept: A working assumption about how measurements within a cluster relate to one another. Exchangeable treats all pairs as equally correlated, AR(1) treats consecutive measurements as more correlated, and independence assumes no correlation. Even if the structure is wrong the robust standard errors remain valid; a correct structure makes the estimates more precise.
Everyday example: If a child's status at visits 1 and 2 is more alike than at visits 1 and 4, AR(1) may be suitable. If the similarity does not change with the distance between visits, the exchangeable structure is sufficient.
What it does: The working correlation matrix (with parameter α). The robust SE is consistent even if the structure is wrong; the right structure improves efficiency. MerQur uses the degrees-of-freedom-corrected moment estimator for all structures.
Effect on the result: Changes the α estimate, β for predictors that vary within clusters, the SEs and QIC.
On the validation data: respiratory treat P: Exchangeable -1.3232 (0.3737); AR(1) -1.2638 (0.3723), α 0.3393; unstructured -1.3203 (0.3738). In this example run QIC is 512.3416; the QIC of 495.37 in the interpretation belongs to the model with exchangeable correlation (the two values come from runs with different correlation structures).
→ Covariance (correlation) structure (UN, VC, AR(1), exchangeable)
Time / order variable
Concept: Gives the order or time of each measurement within a cluster; it is needed to match measurements correctly in time-dependent correlation structures, especially when some measurements are missing.
Everyday example: If a child missed visit 2 and no time variable is given, the visit 3 measurement may be mistaken for visit 2. With the visit number supplied, the AR(1) structure pairs the measurements at the correct distances.
What it does: The wave index for AR(1), unstructured and m-dependent structures (correct matching with missing measurements); only ordering for exchangeable and independence.
Effect on the result: Changes the result only for missing or irregular measurements. A warning is given if AR(1) is selected without a time variable.
On the validation data: amenorrhea (988 missing y): the unstructured result is the same with and without time (trt_time 0.3380; missingness is monotone).
M-dependent lag (m)
Concept: In the m-dependent structure, separate correlations are estimated for measurements m or fewer steps apart; measurements further apart are assumed uncorrelated.
Everyday example: With m = 1 only consecutive visits (1-2, 2-3, 3-4) are treated as correlated; visits 1 and 3 are assumed to be unrelated.
What it does: Separate correlations up to lag m, zero beyond.
Effect on the result: The working correlation and coefficients change. If the banded matrix is not positive definite, MerQur reports the raw moment value with a warning.
On the validation data: In respiratory an m-dependent structure is fitted for m = 1, 2, 3. In dietox (12 weeks) the matrix is not positive definite; the lag-1 correlation is 0.938.
→ Covariance (correlation) structure (UN, VC, AR(1), exchangeable)
Link function (Canonical / identity / log / logit / probit / cloglog / inverse)
Concept: The transformation linking the expected value of the outcome to the linear combination of predictors. Each family has a natural (canonical) link; choosing a different link changes the scale on which the coefficients are interpreted.
Everyday example: For a binary outcome the logit link allows the coefficients to be turned into odds ratios. With a probit link the coefficients can no longer be read as odds ratios; the same treatment effect is expressed on a different scale.
What it does: g(μ) = Xβ; non-canonical links change the interpretation scale.
Effect on the result: The coefficient scale changes; the OR/IRR table is produced only for logit and log links. A link that does not fit the family gives an error.
On the validation data: respiratory treat logit -1.3232, probit -0.7711, cloglog -0.8653; ohio smoke logit 0.2651, log 0.2179.
Offset (log exposure)
Concept: A term with coefficient fixed at 1 that accounts for units having different lengths or sizes of exposure; it usually enters as the logarithm of exposure, so that the model explains a rate rather than a count.
Everyday example: If the outcome is 'number of attacks between visits' and the intervals between visits vary from 2 to 6 weeks, the log of the number of weeks enters as an offset, so that attacks per week are compared.
What it does: Log exposure added to the linear predictor with coefficient 1.
Effect on the result: Changes the intercept; if the exposure is a linear combination of the other predictors, the other coefficients do not change.
On the validation data: epilepsy ltime: intercept 1.3476 (3.4271 without offset); trt_time does not change.
Standard error (Robust (sandwich, default) / Model-based (naive) / Robust + Mancl-DeRouen small-cluster correction)
Concept: The robust (sandwich) standard error is valid even if the working correlation is wrong and is the default in GEE. The model-based standard error assumes the working correlation is correct. With few clusters robust standard errors come out too small; a small-cluster correction compensates for this.
Everyday example: With 120 children in the study the robust standard error is reliable. If only 20 children were followed, the standard error of the treatment effect may look too small; the small-cluster correction widens the interval slightly to give a more honest result.
What it does: Liang-Zeger sandwich, model-based, and small-cluster-corrected sandwich (Mancl and DeRouen, 2001).
Effect on the result: SE, z, p, the confidence interval and the Type III Wald test change.
On the validation data: respiratory treat SE: robust 0.3737, naive 0.3361, Mancl-DeRouen 0.4002. leprosy timeA: robust 0.2186, naive 0.1818.
EMMEANS factor and EMMEANS p adjustment (Bonferroni / Šidák / Tukey / No adjustment)
Concept: Estimated marginal means are model-based means for each level of a categorical factor with the other predictors at their average values; for binary outcomes they can be given as probabilities. Pairwise differences are tested with a multiple-comparison correction.
Everyday example: With age and baseline status at their averages, the model might give a probability of an attack-free week of 0.75 in the inhaler group and 0.55 in the placebo group. With three treatment groups, three pairwise comparisons would be reported with corrected p values.
What it does: Marginal means at the levels of a categorical factor (numeric predictors at their means) and pairwise differences.
Effect on the result: Affects only the marginal-mean and comparison table.
On the validation data: respiratory treat: A 1.1606 (probability 0.7614), P -0.1625 (0.4595), OR 3.755. dietox Cu035-Cu175 p: unadjusted 0.1841, Tukey 0.3794, Bonferroni 0.5522.
EMM second factor (compare within each level): group x time marginal means
Concept: When group and time interact, compares the groups separately at each time point, showing how the effect changes over time.
Everyday example: The difference between inhaler and placebo might be small at visit 1 and large at visit 4. This option compares the two groups at each visit separately, revealing when the treatment begins to show its effect.
What it does: Gives cell and comparison marginal means in a GEE model with a group x time interaction.
Effect on the result: Extra marginal-mean and comparison tables; the main model does not change.
On the validation data: In the BodyWeight subset 60 values are produced; the option was also tested on the epil, toenail and respiratory data.
Save predictions and residuals to the dataset (MEANPRED, XBPRED, PEARSONRESID)
Concept: Adds the model's predicted mean, the linear predictor and the Pearson residual for each observation to the dataset as new columns, for model checking and later analyses.
Everyday example: If each child's predicted probability of an attack-free week at each visit is added to the table, children doing much worse than expected are easily spotted by their large Pearson residuals.
What it does: Writes μ̂, η̂ and the Pearson residual to the dataset.
Effect on the result: Three columns are added to the dataset; the result tables do not change.
On the validation data: dietox row 1: μ̂ 22.3649, Pearson 4.1351; the values are saved for all 861 rows.
Confidence Level (90% / 95% / 99% / Other (custom))
Concept: Sets the confidence level of the intervals for the coefficients and odds or rate ratios; the higher the level, the wider the interval.
Everyday example: For an inhaler OR of 2.5 the 95% confidence interval might be [1.4, 4.5]; at 99% it widens, but the effect remains significant as long as the interval excludes 1.
What it does: The level of the Wald interval (β ± z·SE; exp for OR/IRR).
Effect on the result: Changes the interval limits and the significance mark; does not change the coefficient or SE.
On the validation data: treat interval 90% (-1.938, -0.709), 95% (-2.056, -0.591), 99% (-2.286, -0.361).
QIC / QICu (output)
Concept: QIC is an information criterion for GEE based on the quasi-likelihood instead of the likelihood; a smaller value indicates a better model. QIC is used to compare working correlation structures and QICu to compare different sets of predictors.
Everyday example: If, with the same predictors, the exchangeable structure has a smaller QIC than AR(1), the exchangeable structure is preferred. To see whether age contributes, the QICu values of the models with and without age are compared.
What it does: Pan (2001): QIC = -2QL + 2·tr(Ω_I·V_R); Ω_I is the model-based information under independence, V_R is always the robust covariance. It serves to choose the working correlation structure.
Effect on the result: Given in every run; only differences within the same program are comparable.
On the validation data: QIC: respiratory 495.37 (exchangeable correlation, the model in the interpretation), ohio 1829.47, amenorrhea 4384.36, dietox 915.84.
Example on real data
Data: Koch et al. 1990 respiratory trial, geepack respiratory
Variables: dependent outcome (good/poor 0/1), independents center, treat, sex, age, baseline, age2; cluster cid (patient); Binomial family
- Question: In a respiratory illness trial, does active treatment (A) increase the probability of good respiratory status (outcome = 1) over four visits compared with placebo (P)? Repeated measurements of the same patient were modelled with GEE (binomial, logit, exchangeable correlation, robust SE), adjusting for centre, sex, age, age² and baseline status.
- Assumption: GEE gives population-averaged (marginal) effects; subject-specific interpretation needs a GLMM. With 111 clusters the robust SE is adequate; with fewer clusters a small-sample correction (Mancl-DeRouen) should be considered. The working correlation is 0.303; the repeated-measures structure should not be ignored.
- Result: The odds of good respiratory status are significantly lower in the placebo group than with active treatment: β = -1.323, robust SE = 0.374, z = -3.54, p < .001; OR = 0.266 (95% CI [0.128, 0.554]). Patients good at baseline have 6.59 times the odds of being good at later visits (p < .001); the age effect is curvilinear (age β = -0.207, age² β = 0.0026). Sex (p = .348) and centre (p = .176) are not significant.
- Effect size: Active treatment increases the odds about 3.8-fold. QIC = 495.37, QICu = 482.62; QIC is compared to choose the correlation structure and QICu to choose variables.
- APA: GEE (binomial, exchangeable correlation, robust SE), treatment (P vs A) β = -1.32, SE = 0.37, z = -3.54, p < .001, OR = 0.27, 95% CI [0.13, 0.55].
Related concepts
Covariance (correlation) structure (UN, VC, AR(1), exchangeable)QIC and QICu criteriaEstimated marginal means (EMM)GEE working correlation and marginal modelsRobust (sandwich) standard errors (HC0-HC3)Offset (exposure term)Incidence rate ratio (IRR)Link function
The numbers in the examples are MerQur's output on independent, publicly available validation data; see the MerQur Technical Note for details.