Tutorials › Generalized Linear Mixed Models (GLMM) › AIC And QIC For GLMM-GEE Comparisons

GLMM Versus GEE · Tutorial 153 of 698

AIC And QIC For GLMM-GEE Comparisons

Learn to calculate and interpret AIC and QIC appropriately, and to avoid treating them as a common scale for comparing conditional GLMM and population-averaged GEE models.

Intermediate 12 min read

What You'll Learn

  • Calculate GLMM AIC using the maximized likelihood and the number of estimated model parameters.
  • Distinguish a GLMM marginal likelihood from a GEE quasi-likelihood.
  • Interpret QIC’s robust covariance penalty and distinguish QIC from QICu.
  • Check whether candidate fits use the same outcome data and comparable criterion conventions.
  • Explain why AIC and QIC do not rank models with different estimands on one common scale.

Why These Criteria Require Care

AIC and QIC are often used to compare candidate models for clustered outcomes, but they are not interchangeable scores. A generalized linear mixed model (GLMM) specifies a conditional outcome model given random effects and has a likelihood when its probability model is specified. Generalized estimating equations (GEE) specify a marginal mean model and use a quasi-likelihood criterion rather than a full joint likelihood. AIC is designed for the former setting; QIC is a GEE criterion.

The distinction matters especially when the models target different estimands. A GLMM coefficient describes a relationship conditional on the random effects, while a GEE coefficient describes a population-averaged relationship. A lower numerical value from one criterion does not establish that its model is better than a model scored by the other criterion. First decide what quantity the analysis is meant to estimate; then compare candidate models using a criterion appropriate to that target.

AIC for Likelihood-Based GLMMs

For clusters indexed by \(i=1,\ldots,m\), let \(Y_i\) denote the vector of outcomes in cluster \(i\), and let \(b_i\) denote its random effects. A GLMM specifies a conditional distribution for \(Y_i\) given \(b_i\), along with a distribution for \(b_i\). Its likelihood for the observed outcomes is the marginal likelihood

$$ L(\theta)=\prod_{i=1}^{m}\int f(Y_i\mid b_i;\theta)f(b_i;\theta)\,db_i, $$

where \(\theta\) contains the model parameters. The integral averages over the random-effects distribution; it is not the likelihood obtained by treating estimated cluster effects as known constants. Let \(\ell(\hat{\theta})\) be the maximized log marginal likelihood and \(K\) the number of freely estimated model parameters.

Definition: The Akaike information criterion is \(AIC=-2\ell(\hat{\theta})+2K\). The parameter count includes the estimated fixed-effect coefficients and the estimated random-effects covariance parameters, as well as any other estimated distributional parameters. It does not count each cluster’s estimated random-effect value as a separate free parameter.

AIC balances fit against complexity: the first term rewards a larger maximized likelihood, while the second penalizes the number of estimated parameters. Within a candidate set fitted to the same outcome data, using the same likelihood convention, lower AIC indicates better estimated predictive fit relative to complexity. AIC is not a test of whether a model is true, and a small difference does not establish that the lower-AIC model is substantively superior.

For fixed-effect comparisons in a GLMM, likelihoods should ordinarily be fitted by maximum likelihood rather than restricted maximum likelihood (REML), because REML likelihoods are not generally comparable when the fixed-effects design changes. Comparisons also require the same response observations and a consistent likelihood definition. If one model omits observations used by another, their AIC values do not constitute a fair comparison of fit to the same data.

Worked Example: Comparing Two GLMMs by AIC

Suppose a hypothetical binary-outcome analysis uses the same 18 clinics and the same patient records for two candidate random-intercept logistic GLMMs. The first has four estimated parameters and maximized log marginal likelihood \(-182.4\). The second adds two fixed-effect terms, has six estimated parameters, and maximized log marginal likelihood \(-179.9\). Assume both fits use maximum likelihood and the same likelihood convention.

For the first model,

$$ AIC_1=-2(-182.4)+2(4)=364.8+8=372.8. $$

For the second model,

$$ AIC_2=-2(-179.9)+2(6)=359.8+12=371.8. $$

The second model has the lower AIC by \(372.8-371.8=1.0\). Its improved likelihood more than offsets the penalty for two additional parameters, but the difference is small and does not by itself give a decisive reason to prefer it. The arithmetic is meaningful because the models use the same outcome observations and comparable likelihoods. It does not show that the added terms cause changes in outcome risk.

QIC for GEE

GEE estimates a marginal mean model and accounts for within-cluster dependence through a working correlation structure. In general, it does not specify a full joint probability distribution for all outcomes in a cluster. Consequently, the likelihood-based AIC formula is not directly available. QIC uses a quasi-likelihood evaluated under working independence, with a penalty that accounts for the difference between model-based and robust covariance estimates of the regression coefficients.

Write \(Q(\hat{\beta};I)\) for the independence quasi-likelihood evaluated at the fitted coefficient vector \(\hat{\beta}\). Let \(H_I\) be the inverse of the model-based covariance matrix for \(\hat{\beta}\) calculated under working independence, and let \(V_R\) be the robust sandwich covariance matrix. In this notation, the QIC is

$$ QIC=-2Q(\hat{\beta};I)+2\operatorname{tr}(H_I V_R). $$

The trace term measures the adjustment for uncertainty using the robust covariance rather than relying only on the model-based covariance. Some references and software express the same criterion using different symbols for the inverse covariance or sensitivity matrix, so the precise convention should be checked before comparing reported scores. A commonly reported related criterion, QICu, uses a simpler parameter-count penalty:

$$ QICu=-2Q(\hat{\beta};I)+2p, $$

where \(p\) is the number of regression coefficients in the mean model. QICu is often used to compare mean structures; QIC is commonly used when comparing working correlation structures. Neither is a likelihood-based AIC, and their values should only be compared when the same criterion definition, outcome data, and analysis conventions are used.

Worked Example: Calculating QIC for Two GEE Fits

Consider hypothetical GEE analyses of the same binary outcome records from 30 clinics. The mean model and working-independence quasi-likelihood convention are held fixed, while the candidate working correlation structures differ. For candidate A, \(Q(\hat{\beta};I)=-94.2\) and \(\operatorname{tr}(H_I V_R)=5.6\). For candidate B, the corresponding values are \(-92.8\) and \(4.1\).

For candidate A,

$$ QIC_A=-2(-94.2)+2(5.6)=188.4+11.2=199.6. $$

For candidate B,

$$ QIC_B=-2(-92.8)+2(4.1)=185.6+8.2=193.8. $$

Candidate B has the lower QIC by \(199.6-193.8=5.8\), so it is preferred by this QIC comparison among these two GEE fits. This is a relative criterion-based choice, not proof that candidate B’s working correlation is the true dependence structure. The comparison is appropriate here because the candidates use the same observations, mean model, and QIC convention.

Why the Criteria Cannot Be Put on One Scale

AIC and QIC both include a fit component and a complexity adjustment, but their fit components are different quantities: AIC uses a maximized log likelihood, whereas QIC uses an independence quasi-likelihood. Their penalties also arise from different calculations. Thus, an AIC of 372 and a QIC of 194 are not scores that can be ranked against one another. The numerical difference has no interpretation as evidence for one model over the other.

There is a second, substantive reason not to use the two criteria as a cross-model scoreboard. A GLMM and a GEE may describe different estimands: the GLMM models conditional effects given random effects, while the GEE models population-averaged effects. The question of which target is relevant is scientific and design-based, not something resolved by comparing criterion values. Even if the same records are used, the two fits need not be competing approximations to the same inferential target.

Worked Example: Choosing a Criterion for the Analysis Goal

Suppose a hypothetical trial records a binary outcome repeatedly for patients in 24 clinics. The stated goal is to estimate the population-averaged change in the probability of the outcome associated with treatment. A GEE reports QIC \(=214.6\). A random-intercept GLMM reports AIC \(=398.2\).

It would be incorrect to say that the GEE is preferred because \(214.6<398.2\). The numbers come from different criteria, and the two analyses target different forms of treatment effect. The stated goal calls for a marginal estimand, so the GEE is aligned with that goal. Its QIC can help compare that GEE with other GEE candidates fitted to the same outcome data and under the same QIC convention. The GLMM’s AIC can help compare it with other compatible GLMM candidates. Neither comparison turns the GEE QIC and GLMM AIC into a common scale.

If the scientific goal instead concerned effects conditional on clinic- or patient-level random effects, the GLMM might be the more relevant model family. The choice would then follow from the estimand, not from the smaller-looking criterion value.

Justification and Practical Diagnostics

The \(2K\) in AIC is an estimate of optimism: a model’s fit to the data used to estimate its parameters is typically better than its fit to new data. In regular likelihood settings, estimating \(K\) parameters produces an approximate expected log-likelihood optimism of \(K\). Since deviance is on the \(-2\) log-likelihood scale, the corresponding correction is \(2K\). This motivates AIC as an estimate of relative out-of-sample predictive discrepancy, rather than as a test statistic.

For GEE, the robust covariance can differ from the model-based covariance because the working covariance need not be correct. The QIC trace penalty adjusts for this mismatch. In the special case where the robust and model-based covariance matrices coincide, the penalty reduces to \(2p\), since the trace of a \(p\)-dimensional identity matrix is \(p\). This explains the simpler QICu form, though QICu and QIC can rank candidates differently when the covariance adjustment matters.

Before interpreting either criterion, check the conditions that make the comparison meaningful. For GLMM AIC, confirm that fits use the same observations, outcome definition, and likelihood convention, and that the stated parameter count includes estimated variance and dispersion parameters. For GEE QIC, confirm that the same records, outcome and criterion definition are used; also verify that the fitting procedure converged and that the mean model and working covariance choices are stated.

Warning signs include a nonconverged GLMM, unstable variance estimates, a GEE that failed to converge, or scores computed on different subsets because of missing outcomes. Such problems undermine the numerical comparison. A criterion cannot repair a misspecified mean model, an inappropriate estimand, or a poorly supported random-effects distribution. Review the substantive model assumptions and the fitted estimates alongside the score. When candidate scores are close, uncertainty in the ranking and scientific interpretability deserve more attention than a small numerical advantage.

Common Mistakes and Alternatives

  • Comparing AIC directly with QIC. They use different fit terms and penalties. Compare AIC with compatible AIC values, or QIC with values computed under the same QIC convention.
  • Choosing a model solely because its score is smallest across model families. First identify the estimand required by the scientific question. A conditional and a population-averaged effect are not made interchangeable by a criterion.
  • Counting random-effect estimates as GLMM parameters. The AIC parameter count includes estimated distributional parameters, such as random-effects variances, not each cluster’s conditional mode as a separate model parameter.
  • Ignoring different analysis samples. A lower score from a fit using fewer observed outcomes is not a straightforward improvement over a fit to a larger or different data set.

AIC and QIC are not the only ways to assess candidates. Likelihood-ratio procedures may be available for certain nested likelihood-based models when their regularity conditions hold; they are not a general replacement for QIC in GEE. Predictive validation can assess performance on held-out clusters or observations, provided the validation scheme matches the intended prediction task. These approaches answer different questions, so the analysis should state whether the priority is prediction, a particular estimand, or a parsimonious representation of the data.

Key takeaway: Use AIC to compare compatible likelihood-based GLMM fits and QIC to compare compatible GEE fits. Select the model family according to the estimand and study goal; do not rank a GLMM and a GEE by placing their AIC and QIC values side by side.

Check Your Understanding

Answer each question, then check the solutions below.

  1. A GLMM has maximized log likelihood \(-120.5\) and \(K=5\) estimated parameters. Calculate its AIC.
  2. Two GEE fits have the same data and criterion convention. Their QIC values are 156.2 and 151.7. What does the difference support, and what does it not establish?
  3. Why is it invalid to prefer a GEE with QIC \(=190\) to a GLMM with AIC \(=350\) simply because 190 is smaller?
  4. A GLMM comparison changes the fixed-effects model but uses REML likelihoods. What is the concern, and what fitting approach is ordinarily used instead?

Solutions. (1) \(AIC=-2(-120.5)+2(5)=241+10=251\). (2) The first GEE candidate, with QIC 151.7, is preferred by QIC within this compatible comparison. The difference does not prove it is the true dependence structure or that its scientific model is correct. (3) AIC and QIC are based on different fit criteria and may target conditional versus population-averaged effects; their values are not on a common scale. (4) REML likelihoods are generally not comparable when fixed effects change. Maximum likelihood is ordinarily used for that GLMM comparison.

Clinical Biostats