Tutorials › Generalized Linear Mixed Models (GLMM) › Reporting Conditional Odds Ratios from glmer

Software and Case Studies · Tutorial 665 of 698

Reporting Conditional Odds Ratios from glmer

Convert logistic GLMM fixed effects into clearly defined conditional odds ratios and report their uncertainty without confusing them with marginal effects or probability changes.

Intermediate 11 min read

What You'll Learn

  • Define a conditional odds ratio from a logistic GLMM fixed-effect contrast.
  • Exponentiate a coefficient and its confidence limits correctly.
  • Report categorical contrasts with their reference categories and continuous effects with units.
  • Interpret an interaction as a contrast that depends on the other predictor.
  • Distinguish conditional odds ratios from marginal odds ratios and probability changes.
  • Recognize when a reported Wald interval or odds ratio may be misleading.

Why the Conditional Odds Ratio Needs a Clear Contrast

A logistic GLMM estimates effects on the log-odds scale. Reporting those coefficients directly can be difficult to interpret, so analysts often exponentiate them and report odds ratios. But an odds ratio is meaningful only when the comparison is explicit: which predictor values are contrasted, what is held fixed, and what category is the reference? In a GLMM, it also matters that the comparison is conditional on the random effects, rather than averaged over the population distribution of those effects.

This tutorial focuses on translating fixed-effect estimates from a fitted logistic model using glmer into conditional odds ratios. The earlier material on reading the summary output from lme4 provides the context for locating fixed-effect estimates and their standard errors. Here the task is to turn those quantities into accurate, well-qualified results.

Definition: In a logistic GLMM, a conditional odds ratio compares the odds of the outcome at two specified predictor values while holding the random effects and other model predictors fixed. For a fixed-effect contrast with log-odds difference \(\Delta\), the conditional odds ratio is \(\exp(\Delta)\).

Model and Interpretation

For a binary outcome \(Y_{ij}\) on observation \(i\) in cluster \(j\), consider a logistic random-intercept model:

$$ Y_{ij}\mid b_j \sim \operatorname{Bernoulli}(p_{ij}), \qquad \operatorname{logit}(p_{ij})=\beta_0+\beta_1x_{ij}+b_j,\qquad b_j\sim N(0,\tau^2). $$

Here \(p_{ij}=P(Y_{ij}=1\mid b_j,x_{ij})\), and \(\operatorname{logit}(p)=\log\{p/(1-p)\}\). The coefficient \(\beta_1\) is the change in conditional log odds for a one-unit increase in \(x\), with the cluster effect held fixed. Therefore the corresponding conditional odds ratio is \(\exp(\beta_1)\). If \(x\) is binary, this is the odds at \(x=1\) divided by the odds at \(x=0\), conditional on the same value of \(b_j\).

This interpretation relies on a suitable model for the conditional outcome: the logit link and fixed-effect structure must represent the intended relationship; observations must be conditionally independent given the modeled predictors and random effects; and the random-effects structure and distribution must be reasonable for the clustering. The reported interval and test also rely on the approximation used for inference, commonly a Wald approximation based on the estimated standard error. These assumptions are not verified merely by exponentiating an estimate. Convergence warnings, separation, sparse outcome patterns, or an inadequate random-effects structure can make the fitted estimate or its uncertainty unreliable.

For a factor, the coefficient depends on its reference level. With treatment coding, a coefficient for “active” compares active with the designated reference, such as “control.” For a continuous predictor, the unit matters: an odds ratio per one unit may be unhelpfully small or large, so a scientifically meaningful increment can be reported instead. If an interaction is present, the odds ratio for one predictor depends on the value of the interacting predictor; a single coefficient alone does not describe every contrast.

From Log Odds to an Odds Ratio

Exponentiation is appropriate because the exponential function reverses the log transformation used in the model. For a coefficient estimate \(\hat\beta\), the estimated odds ratio is \(\exp(\hat\beta)\). If a Wald confidence interval on the log-odds scale is \([L,U]\), the corresponding interval on the odds-ratio scale is \([\exp(L),\exp(U)]\). Since exponentiation is increasing, the lower endpoint stays lower than the upper endpoint.

$$ \widehat{\mathrm{OR}}=\exp(\hat\beta),\qquad [L,U]=\left[\hat\beta-1.96SE,\ \hat\beta+1.96SE\right],\qquad \mathrm{CI}_{\mathrm{OR}}=[\exp(L),\exp(U)]. $$

The multiplier 1.96 gives an approximate 95% Wald interval when the estimate is approximately normal with the reported standard error. It is not an exact guarantee of coverage in every GLMM. A two-sided Wald test of \(H_0:\beta=0\) uses \(z=\hat\beta/SE\); on the odds-ratio scale the null value is 1. A p-value does not give the probability that the null hypothesis is true.

Worked Example: Active Treatment Versus Control

Suppose a hypothetical analysis includes 240 patients in 12 clinics, with a binary outcome recorded once per patient. A logistic random-intercept model uses treatment as a factor with control as the reference. Assume the fitted model converged without warnings, the treatment coding is correct, and the random-intercept model is the intended conditional model. Its hypothetical summary reports a treatment estimate of \(-0.5108\) and standard error \(0.2693\).

The active-versus-control conditional odds ratio is \(\exp(-0.5108)=0.6000\). Thus, for patients with the same clinic random intercept and the same values of other modeled predictors, the estimated odds of the outcome in the active group are 0.6000 times the odds in the control group.

The 95% Wald interval on the log-odds scale is \(-0.5108\pm1.96(0.2693)\). The margin is \(1.96(0.2693)=0.527828\), so the endpoints are \(-0.5108-0.527828=-1.038628\) and \(-0.5108+0.527828=0.017028\). Rounding to four decimal places gives \([-1.0386,0.0170]\). Exponentiating those endpoints gives an odds-ratio interval of approximately \([0.3539,1.0172]\).

The Wald statistic is \(z=-0.5108/0.2693=-1.897\), giving a two-sided p-value of approximately \(0.0578\). At the 0.05 significance level, this test does not reject \(H_0:\beta_{\text{treatment}}=0\). The interval includes 1, consistent with that test. A suitable report is: “In the fitted logistic random-intercept model, the estimated conditional odds of the outcome for active treatment were 0.60 times those for control, conditional on clinic and other modeled predictors (95% Wald CI 0.35 to 1.02; \(p=0.058\)).” This is an estimate with uncertainty, not evidence that the null is true.

Choosing the Increment and Reporting Units

For a continuous predictor, the coefficient is the log-odds change per one-unit increase. If one unit is not a useful contrast, rescale the coefficient to a chosen increment. For an increase of \(c\) units in a linear predictor with no interaction involving \(x\), the log-odds contrast is \(c\beta\), and the conditional odds ratio is \(\exp(c\beta)\). State that increment and its units in the report.

Worked Example: A Dose Increase of Five Milligrams

Suppose a hypothetical logistic GLMM analyzes a binary response among 180 participants nested in 15 clinics. Dose is measured in milligrams, entered as a continuous linear predictor, and the model includes a clinic random intercept. Assume the fit converged, the dose scale and units were checked, and a linear effect on the conditional log-odds scale is the intended specification. The hypothetical estimate per one milligram is \(0.03646\), with standard error \(0.01420\). For a five-milligram increase, the log-odds contrast is \(5(0.03646)=0.1823\), so the conditional odds ratio is \(\exp(0.1823)=1.200\).

For the five-milligram contrast, the standard error is \(5(0.01420)=0.07100\). The Wald interval is \(0.1823\pm1.96(0.07100)\), or \(0.1823\pm0.13916=[0.04314,0.32146]\). Exponentiating gives approximately \([1.044,1.379]\). The Wald statistic is \(0.1823/0.07100=2.568\), with a two-sided p-value of about \(0.0102\).

A report could state: “For each 5 mg higher dose, the estimated conditional odds of the response were 1.20 times as high (95% Wald CI 1.04 to 1.38; \(p=0.010\)), conditional on clinic and other modeled predictors.” This describes a 20% increase in odds, not a 20-percentage-point increase in probability. If the model instead included a nonlinear dose term or an interaction, this simple five-unit calculation would not, by itself, describe the contrast.

Interactions Require Specified Contrasts

When two predictors interact, the conditional log-odds contrast for one predictor includes both its main-effect coefficient and the relevant interaction term. Consider treatment \(T\) coded 1 for active and 0 for control, and a continuous severity score \(S\), with linear predictor \(\beta_0+\beta_TT+\beta_SS+\beta_{TS}TS+b_j\). The active-versus-control log-odds contrast at severity \(S=s\) is \(\beta_T+s\beta_{TS}\); its odds ratio is \(\exp(\beta_T+s\beta_{TS})\). The main-effect coefficient \(\beta_T\) alone gives the treatment contrast only at \(S=0\).

Worked Example: Treatment Effect at Two Severity Scores

Suppose a hypothetical study records outcomes for 200 patients at 10 clinics. A logistic random-intercept model includes treatment, baseline severity, and their interaction. Assume the model converged, severity is measured in its stated score units, and the interaction was included because the treatment contrast may vary with severity. The hypothetical estimates are \(\hat\beta_T=-0.40\) and \(\hat\beta_{TS}=0.25\) per severity-score unit.

At severity \(s=0\), the treatment log-odds contrast is \(-0.40+0(0.25)=-0.40\), so the conditional odds ratio is \(\exp(-0.40)=0.6703\). At severity \(s=2\), the contrast is \(-0.40+2(0.25)=0.10\), and the conditional odds ratio is \(\exp(0.10)=1.105\). Both comparisons hold the clinic random intercept and other predictors fixed. They show why reporting only \(\exp(\hat\beta_T)\) would not summarize the treatment contrast across severity values.

An interval for the severity-2 contrast must account for uncertainty in both estimates and their covariance. Its variance is \(\operatorname{Var}(\hat\beta_T+2\hat\beta_{TS})=\operatorname{Var}(\hat\beta_T)+4\operatorname{Var}(\hat\beta_{TS})+4\operatorname{Cov}(\hat\beta_T,\hat\beta_{TS})\). It is not correct to add the two standard errors. A report should name the severity value and give an interval computed for that combined contrast; the two point estimates above alone do not supply that interval.

Conditional, Marginal, and Probability-Scale Results

A conditional odds ratio is defined at fixed random effects. In a random-intercept model, the same intercept appears in both groups being compared, so it cancels from their conditional log-odds difference. However, averaging predicted probabilities over the random-effects distribution generally does not produce the same odds ratio as exponentiating a fixed-effect coefficient. This difference is one consequence of the nonlinearity of the logit link and the non-collapsibility of odds ratios.

A population-averaged analysis targets a different quantity: it averages over clusters or random effects rather than comparing outcomes at the same random effect. Similarly, a probability difference or risk ratio is not obtained simply by relabeling a conditional odds ratio. Probability changes depend on the starting probability and, in a GLMM, on the random-effects distribution and covariate values. When the scientific question concerns absolute probabilities, report predictions or contrasts on the probability scale with their own uncertainty rather than implying that an odds ratio is a probability ratio.

Reporting Checks and Common Pitfalls

Before writing a result, verify the coefficient’s coding and contrast, the unit or predictor value at which it applies, the estimate and standard error, and the calculation of the interval. Confirm that the model fit and diagnostics do not raise a material concern; convergence warnings, very sparse outcome categories, or separation can undermine routine Wald summaries. A confidence interval crossing 1 indicates that the corresponding two-sided 5% Wald test does not reject the null, subject to the same approximation and model.

  • Reversing the contrast: An odds ratio below 1 for active versus control becomes its reciprocal for control versus active. State the numerator and denominator groups.
  • Omitting the reference category: “Treatment OR = 0.60” is incomplete if the reader cannot tell whether treatment was compared with control, usual care, or another category.
  • Calling an odds ratio a risk ratio: An OR of 1.20 means 20% higher odds, not necessarily 20% higher probability or risk.
  • Ignoring an interaction: With an interaction, the main-effect odds ratio applies at the interacting predictor’s reference or zero value, not universally.
  • Exponentiating only the estimate: A complete interval requires exponentiating both log-scale endpoints, not adding and subtracting a margin on the odds-ratio scale.
  • Overstating uncertainty evidence: A 95% confidence interval is produced by a procedure with approximately 95% long-run coverage under its assumptions; it is not a 95% probability statement about this particular fixed parameter.

A practical reporting sentence usually names the outcome, the contrast, the reference group or predictor increment, the conditional nature of the estimate, the odds ratio, its interval, and—when relevant—the test result. Avoid causal language unless the study design and assumptions justify a causal interpretation.

Key takeaway: Exponentiate a fixed-effect log-odds contrast to obtain a conditional odds ratio, and exponentiate both confidence-limit endpoints to obtain its interval. A clear report states exactly which predictor values are compared, what is held fixed, and whether an interaction makes the contrast depend on another predictor.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A treatment coefficient is \(0.30\), with usual care as the reference. What is the conditional odds ratio for treatment versus usual care?
  2. A continuous predictor has a coefficient of \(-0.08\) per unit. What is the conditional odds ratio for a 3-unit increase?
  3. A log-odds Wald interval is \([-0.20,0.40]\). Give the odds-ratio interval and state whether it includes the null value.
  4. In a model with an interaction, explain why exponentiating the treatment main-effect coefficient may not give the treatment odds ratio at every severity score.
  5. Why is it incorrect to describe an odds ratio of 1.20 as a 20-percentage-point increase in outcome probability?

Solutions. (1) \(\exp(0.30)=1.350\): the conditional odds under treatment are estimated to be 1.350 times those under usual care, holding the random effects and other predictors fixed. (2) The contrast is \(3(-0.08)=-0.24\), so the odds ratio is \(\exp(-0.24)=0.7866\) for a 3-unit increase. (3) Exponentiation gives \([\exp(-0.20),\exp(0.40)]=[0.8187,1.492]\), which includes 1, the null odds ratio. (4) The interaction contributes to the treatment log-odds contrast, so the contrast is the treatment coefficient plus the interaction coefficient multiplied by the severity value; it changes with severity. (5) An odds ratio compares odds, not probabilities. The probability change depends on the starting probability and cannot be read as a fixed percentage-point difference from the odds ratio alone.

Clinical Biostats