Tutorials › Generalized Linear Mixed Models (GLMM) › A Worked Logistic Random-Intercept Interpretation

Random Intercepts and Slopes · Tutorial 41 of 698

A Worked Logistic Random-Intercept Interpretation

Calculate and interpret cluster-specific odds and probabilities from a logistic random-intercept model, while keeping conditional predictions distinct from population averages.

Intermediate 10 min read

What You'll Learn

  • Write the conditional probability model for a binary response with a random intercept.
  • Convert a specified linear predictor into conditional odds and a conditional probability.
  • Interpret how changing the random intercept shifts a cluster’s baseline odds.
  • Compare conditional probabilities across covariate values and clusters.
  • Distinguish cluster-specific predictions from predictions averaged over the random-effects distribution.
  • Check arithmetic and recognize common interpretation errors.

From a Cluster’s Linear Predictor to Its Probability

A logistic random-intercept model gives each cluster its own baseline on the log-odds scale. To interpret a prediction, specify both the covariate value and the cluster’s random-intercept value, then transform the resulting linear predictor into odds and a probability. The calculation is simple, but the conditioning matters: the result describes a response probability for a specified cluster deviation, not an average over all clusters.

Definition: For binary response \(Y_{ij}\), covariate \(x_{ij}\), and cluster \(j\), a logistic random-intercept model is $$ Y_{ij}\mid b_j,x_{ij}\sim\operatorname{Bernoulli}(p_{ij}),\qquad \operatorname{logit}(p_{ij})=\log\left(\frac{p_{ij}}{1-p_{ij}}\right)=\beta_0+\beta_1x_{ij}+b_j. $$ Here \(p_{ij}=P(Y_{ij}=1\mid x_{ij},b_j)\), \(\beta_0\) is the fixed intercept, \(\beta_1\) is the fixed covariate coefficient, and \(b_j\) is cluster \(j\)'s random-intercept deviation. The conventional random-effects assumption is \(b_j\sim N(0,\tau_{00})\), with independent random effects across clusters. Responses are assumed independent conditional on the random effects and covariates.

The conditional linear predictor is \(\eta_{ij}=\beta_0+\beta_1x_{ij}+b_j\). For any specified \(\eta_{ij}\), the conditional odds are \(\exp(\eta_{ij})\), and the conditional probability is

$$ p_{ij}=\frac{\exp(\eta_{ij})}{1+\exp(\eta_{ij})} =\frac{1}{1+\exp(-\eta_{ij})}. $$

These are two equivalent forms of the inverse-logit transformation. A positive \(b_j\) raises the linear predictor and hence the cluster’s odds at every fixed \(x_{ij}\); a negative \(b_j\) lowers them. The value \(b_j=0\) represents the model’s reference cluster on the link scale. It does not necessarily represent the average cluster’s probability.

Why the Transformation Works

Starting with the definition of the logit, \(\log(p/(1-p))=\eta\), exponentiate both sides to obtain \(\exp(\eta)=p/(1-p)\). Multiplying by \(1-p\) and collecting the terms involving \(p\) gives

$$ \exp(\eta)(1-p)=p \quad\Longrightarrow\quad \exp(\eta)=p\{1+\exp(\eta)\} \quad\Longrightarrow\quad p=\frac{\exp(\eta)}{1+\exp(\eta)}. $$

The odds-to-probability conversion follows from the same algebra. If the odds are \(o=p/(1-p)\), then \(o(1-p)=p\), so \(p=o/(1+o)\). Odds and probabilities therefore contain the same information, but they are not numerically interchangeable: odds can exceed 1, whereas probabilities lie between 0 and 1.

For a numerical prediction, the model is conditional on a specified \(b_j\). The normal distribution for \(b_j\) describes variation across clusters; it is not needed to perform the inverse-logit calculation once a particular value of \(b_j\) has been selected. When fitted coefficients are used, the resulting probabilities are model-based plug-in predictions, with parameter-estimation uncertainty not included unless it is separately calculated.

Worked Example: Two Cluster Baselines at the Same Covariate Value

Suppose a hypothetical fitted model for a binary outcome is \(\operatorname{logit}(p_{ij})=-1.5+0.8x_{ij}+b_j\). Calculate the conditional odds and probability for \(x_{ij}=1\) in two clusters, one with \(b_j=-0.7\) and one with \(b_j=0.5\).

Cluster A. Its conditional linear predictor is \(\eta=-1.5+0.8(1)-0.7=-1.4\). Thus its odds are \(\exp(-1.4)\approx0.2466\), and its conditional probability is \[ p=\frac{\exp(-1.4)}{1+\exp(-1.4)}\approx0.1978. \] The probability is about 19.78% for an observation with \(x=1\) in a cluster with this specified intercept deviation.

Cluster B. Its predictor is \(\eta=-1.5+0.8(1)+0.5=-0.2\). Its odds are \(\exp(-0.2)\approx0.8187\), and its conditional probability is \[ p=\frac{\exp(-0.2)}{1+\exp(-0.2)}\approx0.4502. \] The displayed expressions retain the unrounded exponentials in the probability calculations; the odds are shown rounded for reporting.

At the same covariate value, Cluster B has a higher conditional probability than Cluster A. Their odds ratio is \(\exp\{0.5-(-0.7)\}=\exp(1.2)\approx3.320\), because the difference in their random intercepts is 1.2. The conditional probability difference, calculated from the unrounded probabilities, is approximately \(0.450166-0.197816=0.2524\), or 25.24 percentage points. This probability difference is specific to this covariate value and these cluster deviations.

Changing the Covariate and the Cluster Deviation

A fixed covariate coefficient changes the conditional log odds by the same amount for each one-unit covariate increase, regardless of the cluster. The corresponding odds multiplier is \(\exp(\beta_1)\). However, the probability change is not generally constant across covariate values or clusters: the inverse-logit transformation is nonlinear. Thus a single odds ratio does not imply a single probability difference.

Worked Example: A Covariate Contrast Within One Cluster

Consider the hypothetical model \(\operatorname{logit}(p_{ij})=-2+0.45x_{ij}+b_j\). For a cluster with \(b_j=0.4\), compare conditional predictions at \(x_{ij}=0\) and \(x_{ij}=2\).

At \(x=0\), \(\eta=-2+0.45(0)+0.4=-1.6\). The odds are \(\exp(-1.6)\approx0.2019\), and the probability is \[ p=\frac{\exp(-1.6)}{1+\exp(-1.6)}\approx0.1680. \] At \(x=2\), \(\eta=-2+0.45(2)+0.4=-0.7\). The odds are \(\exp(-0.7)\approx0.4966\), and the probability is \[ p=\frac{\exp(-0.7)}{1+\exp(-0.7)}\approx0.3318. \]

Increasing \(x\) by two units multiplies the conditional odds by \(\exp\{0.45(2)\}=\exp(0.9)\approx2.460\). This agrees with the odds computed before rounding: \(\exp(-0.7)/\exp(-1.6)=\exp(0.9)\). The probability increases by about \(0.331812-0.167982=0.1638\), or 16.38 percentage points. That probability change is the result for this cluster and this covariate contrast; it is not a universal effect of a two-unit increase.

Worked Example: Comparing Two Clusters at a Fixed Covariate Value

Suppose a second hypothetical model is \(\operatorname{logit}(p_{ij})=-0.8-0.6x_{ij}+b_j\). At \(x=1\), compare a cluster with \(b_j=0.3\) with a cluster having \(b_j=-0.4\).

For the first cluster, \(\eta=-0.8-0.6(1)+0.3=-1.1\). Its odds are \(\exp(-1.1)\approx0.3329\), and its probability is \[ p=\frac{\exp(-1.1)}{1+\exp(-1.1)}\approx0.2497. \] For the second cluster, \(\eta=-0.8-0.6(1)-0.4=-1.8\). Its odds are \(\exp(-1.8)\approx0.1653\), and its probability is \[ p=\frac{\exp(-1.8)}{1+\exp(-1.8)}\approx0.1419. \]

At this fixed \(x\), the first cluster’s odds are \(\exp\{0.3-(-0.4)\}=\exp(0.7)\approx2.014\) times the second cluster’s odds. The probability difference, using the unrounded inverse-logit values, is approximately \(0.249740-0.141851=0.1079\), or 10.79 percentage points. The negative coefficient \(-0.6\) describes the covariate’s conditional log-odds change per unit; it does not mean every one-unit increase reduces probability by the same number of percentage points.

Assumptions, Diagnostics, and Interpretation Checks

These calculations rely on a binary response and the specified logit conditional mean model. They also rely on the random-intercept structure being an adequate description: after conditioning on \(b_j\) and the covariates, the model assigns the stated Bernoulli probability to each response, and the conditional-independence assumption is appropriate for the observations. The normal random-effects distribution is part of the usual model specification, though it does not change the arithmetic for a selected \(b_j\).

A useful way to check a calculation is to examine its direction and scale. If \(\eta=0\), odds equal 1 and probability equals 0.5. Positive \(\eta\) must yield probability above 0.5; negative \(\eta\) must yield probability below 0.5. Larger \(\eta\) must produce larger odds and probability. Probabilities must remain strictly between 0 and 1 for finite \(\eta\). For very large positive or negative predictors, direct computation of \(\exp(\eta)\) can overflow or underflow; the equivalent form \(1/\{1+\exp(-\eta)\}\), or a numerically stable software implementation, avoids some such issues.

A calculated value is only as relevant as its covariate reference point. If \(x=0\) has no substantive meaning, the fixed intercept and the prediction at \(x=0\) may be mathematically valid but scientifically unhelpful. Likewise, a chosen \(b_j\) should be identified as a specified deviation, such as a hypothetical value or an estimated cluster effect, rather than described as a known cluster characteristic without qualification. The random-effects distribution can help contextualize whether a selected value is typical, but the conditional calculation itself does not establish that.

The main alternative interpretations answer different questions. A logistic regression without a random intercept gives a common intercept rather than cluster-specific baselines. A logistic random-intercept prediction conditions on a given \(b_j\). A population-averaged probability instead averages the conditional probabilities over the random-effects distribution, for example \(E_{b_j}\{\operatorname{logit}^{-1}(\beta_0+\beta_1x+b_j)\}\). Because the inverse-logit function is nonlinear, this average is generally not equal to \(\operatorname{logit}^{-1}(\beta_0+\beta_1x)\). The latter is the prediction at \(b_j=0\), not automatically the population average. Estimating or interpreting marginal effects requires an explicit averaging calculation and is a distinct target from the conditional predictions worked here.

Common Mistakes

  • Calling a conditional prediction a population average. A value computed at \(b_j=0\) is conditional on that link-scale deviation. It is not generally the average probability across clusters.
  • Treating \(b_j\) as a probability adjustment. The random intercept is added to the log odds. It must be included in \(\eta\) before applying the inverse-logit transformation.
  • Confusing odds and probability. If the odds are \(o\), the probability is \(o/(1+o)\), not \(o\). Odds of 0.5 correspond to probability \(0.5/1.5=0.3333\), not 0.5.
  • Assuming a constant probability difference. The coefficient \(\beta_1\) implies a fixed change in conditional log odds per unit of \(x\); the corresponding probability change depends on the starting predictor.
  • Rounding intermediate values too early. Use the unrounded exponential or probability in subsequent arithmetic, then round the final reported result. A result calculated from rounded odds can differ in its last reported digit.
Key takeaway: To interpret a logistic random-intercept prediction, state the covariate value and random-intercept value, calculate \(\eta=\beta_0+\beta_1x+b_j\), and report the conditional odds and probability from that same predictor. Label the result as cluster-specific; do not silently replace it with a population average.

Check Your Understanding

Try each calculation, then compare with the brief solutions below.

  1. For \(\operatorname{logit}(p)=-1.2+0.5x+b_j\), calculate the odds and probability at \(x=2\) and \(b_j=-0.3\).
  2. If a cluster’s random intercept increases by 0.4 while \(x\) is fixed, by what factor do its conditional odds change?
  3. For \(\operatorname{logit}(p)=-2+0.7x+b_j\), calculate the probability at \(x=1\), \(b_j=0.2\). Is it above or below 0.5?
  4. Explain why the prediction at \(b_j=0\) is not necessarily the population-averaged probability.

Solutions. (1) \(\eta=-1.2+0.5(2)-0.3=-0.5\); the odds are \(\exp(-0.5)\approx0.6065\), and \(p=\exp(-0.5)/\{1+\exp(-0.5)\}\approx0.3775\). (2) The odds multiplier is \(\exp(0.4)\approx1.492\). (3) \(\eta=-2+0.7(1)+0.2=-1.1\); the odds are \(\exp(-1.1)\approx0.3329\), and \(p=\exp(-1.1)/\{1+\exp(-1.1)\}\approx0.2497\), below 0.5 because the predictor is negative. (4) The population average averages inverse-logit probabilities over the random-intercept distribution, whereas \(b_j=0\) evaluates the inverse logit at one particular deviation. Nonlinearity means these operations are generally unequal.

Clinical Biostats