Why the Cluster Matters for a Binary Imputation
Suppose a health service records whether each patient attended a follow-up visit, with patients nested within clinics. Patients at the same clinic may have more similar attendance than patients at different clinics because of shared access, staffing, or local practice. A single-level logistic regression can miss this clustering. For imputing a missing binary value, that omission can distort both the predicted probability and the uncertainty in the imputed values.
A random-intercept logistic model represents this structure by allowing each cluster to have its own baseline log-odds, while estimating a common relationship between the outcome and included predictors. Here the focus is the model and the meaning of its probabilities, not a general treatment of multilevel imputation.
The conditioning matters. \(p_{ij}\) is the probability for a person with those predictor values in a cluster whose random intercept is \(b_i\). It is not automatically the population-average probability for someone drawn from a new cluster. The cluster effect is on the log-odds scale: a positive \(b_i\) increases the odds of the event, and a negative \(b_i\) decreases them.
Assumptions and the Imputation Distribution
The model is useful when its structure is plausible for the data being imputed. Conditional on the predictors and cluster effect, individuals' binary outcomes are assumed to follow Bernoulli distributions with the probabilities specified by the logistic equation. The random-intercept form assumes that clusters differ in baseline log-odds but share the same predictor slopes. It also assumes the random intercepts follow the specified normal distribution and are independent of the included predictors.
For imputation, the predictors should include variables needed to preserve the relationships of interest in the later analysis, as well as useful observed auxiliary information. If an interaction or nonlinear relationship is important to the intended analysis, the imputation model needs to represent it; a random intercept alone does not do so. The missingness assumption also matters: a conventional imputation analysis relies on missingness being explainable by variables included in the imputation model, rather than depending on the unobserved binary value after conditioning on those variables. That assumption cannot generally be confirmed from observed data alone.
For a missing \(Y_{ij}\), the model supplies a conditional probability \(p_{ij}\). Given a specified set of model parameters and cluster effect, the binary imputation is a Bernoulli draw: it is 1 with probability \(p_{ij}\) and 0 with probability \(1-p_{ij}\). In multiple imputation, uncertainty in the model must also be represented; repeatedly filling missing entries using only one fixed set of estimated values can understate uncertainty. The calculations below focus on specifying and interpreting the probability model.
Worked Example: Calculate a Clinic-Specific Probability
All values in this example are hypothetical. Let \(Y_{ij}=1\) indicate attendance at a follow-up visit. Suppose a fitted model is $$ \operatorname{logit}(p_{ij})=-1.00+0.80T_{ij}+0.50A_{ij}+0.60S_i+b_i, $$ where \(T_{ij}\) indicates a reminder text (1 if received), \(A_{ij}\) is age centered at 50 years and measured in decades, and \(S_i\) indicates a clinic with extended evening hours. Consider a patient who received a text, is 55 years old, attends a clinic with evening hours, and is in a hypothetical clinic with \(b_i=-0.40\).
For this patient, \(T_{ij}=1\), \(A_{ij}=(55-50)/10=0.50\), and \(S_i=1\). Substitute these values: $$ \eta_{ij}=-1.00+(0.80)(1)+(0.50)(0.50)+(0.60)(1)-0.40=0.25. $$
The logistic transformation gives $$ p_{ij}=\frac{\exp(0.25)}{1+\exp(0.25)} =\frac{1.284}{1+1.284} =0.562. $$
Conditional on the stated predictors and this clinic effect, the model assigns this patient a 56.2% probability of attendance. If the attendance value is missing, a Bernoulli imputation based on these conditions has probability 0.562 of being 1. The calculation does not mean that the imputed value should always be 1, nor that the clinic effect is known without uncertainty in an actual imputation.
What the Coefficients and Random Intercept Mean
The fixed effects describe associations conditional on the cluster effect and the other included predictors. For a one-unit increase in a predictor \(x\) with coefficient \(\beta\), holding other terms and \(b_i\) fixed, the conditional odds are multiplied by \(\exp(\beta)\). This is a conditional odds ratio, not a change of \(\beta\) in probability points. Because the logistic transformation is nonlinear, the probability change depends on the starting probability.
The random intercept shifts the linear predictor for all individuals in a cluster by the same amount. Comparing two clusters with the same fixed predictor values, a difference of \(d\) in their random intercepts multiplies their conditional odds by \(\exp(d)\). It does not add \(d\) to their probabilities.
Worked Example: Compare Two Clusters
Suppose two hypothetical clinics have the same fixed-predictor contribution, \(-0.50\), but their random intercepts are \(-0.70\) and \(0.70\). For the first clinic, $$ \eta_1=-0.50-0.70=-1.20,\qquad p_1=\frac{\exp(-1.20)}{1+\exp(-1.20)} =\frac{0.3010}{1.3010}=0.231. $$
For the second clinic, $$ \eta_2=-0.50+0.70=0.20,\qquad p_2=\frac{\exp(0.20)}{1+\exp(0.20)} =\frac{1.221}{2.221}=0.550. $$
The conditional attendance probabilities are about 23.1% and 55.0%, respectively. The difference between the clinic effects is \(0.70-(-0.70)=1.40\), so the ratio of the clinics' conditional odds is $$ \frac{\operatorname{odds}_2}{\operatorname{odds}_1} =\exp(1.40)=4.055. $$
The odds are about 4.06 times as high in the second clinic at these fixed predictor values. This is not a statement that its probability is 4.06 times as high: the probability ratio is \(0.550/0.231\), about 2.38.
Conditional and Population-Average Probabilities
A population-average probability averages over the distribution of random intercepts. If the fixed-predictor contribution is \(a\), the marginal probability is $$ P(Y_{ij}=1\mid \mathbf{x}_{ij},\mathbf{z}_i) =\int \frac{\exp(a+b)}{1+\exp(a+b)} f(b)\,db, $$ where \(f(b)\) is the density of the random intercept. In general, this integral is not equal to the probability calculated by setting \(b=0\). The logistic function is nonlinear, so averaging probabilities over clusters is not the same operation as applying the logistic function to the average random intercept. Consequently, conditional odds ratios and population-average odds ratios generally differ.
Worked Example: Approximate a Population-Average Probability
Continue with a hypothetical model in which the fixed-predictor contribution is \(a=-0.50\) and \(b_i\sim N(0,0.80^2)\). The probability for a cluster with \(b_i=0\) is $$ \operatorname{logit}^{-1}(-0.50)=\frac{\exp(-0.50)}{1+\exp(-0.50)} =\frac{0.6065}{1.6065}=0.378. $$
To illustrate averaging over clusters, use a three-point Gaussian quadrature approximation for a normal random intercept. The nodes for \(b\) are \(-\sqrt{3}(0.80)\), \(0\), and \(+\sqrt{3}(0.80)\), approximately \(-1.386\), \(0\), and \(1.386\), with weights \(1/6\), \(2/3\), and \(1/6\). The corresponding probabilities are approximately $$ \operatorname{logit}^{-1}(-0.50-1.386)=0.132,\quad \operatorname{logit}^{-1}(-0.50)=0.378,\quad \operatorname{logit}^{-1}(-0.50+1.386)=0.708. $$
The quadrature approximation to the population-average probability is therefore $$ \frac{1}{6}(0.132)+\frac{2}{3}(0.378)+\frac{1}{6}(0.708) =0.0220+0.252+0.118=0.392. $$
This illustrative approximation is about 39.2%, compared with 37.8% for a cluster at \(b_i=0\). It demonstrates why setting the random intercept to its mean does not generally give the population-average probability. The quadrature is a numerical approximation to the integral, not a replacement for the model's normal random-effect assumption.
Derivation and Model Checks
The form of the model follows from the logistic link. For a conditional event probability \(p_{ij}\), the conditional odds are \(p_{ij}/(1-p_{ij})\). Modeling the logarithm of these odds as a linear predictor gives $$ \log\left(\frac{p_{ij}}{1-p_{ij}}\right)=\eta_{ij}, \qquad \frac{p_{ij}}{1-p_{ij}}=\exp(\eta_{ij}). $$
Solving the second equation for \(p_{ij}\) gives \(p_{ij}=\exp(\eta_{ij})(1-p_{ij})\), so \(p_{ij}\{1+\exp(\eta_{ij})\}=\exp(\eta_{ij})\). Thus $$ p_{ij}=\frac{\exp(\eta_{ij})}{1+\exp(\eta_{ij})} =\frac{1}{1+\exp(-\eta_{ij})}. $$
This transformation guarantees a probability strictly between 0 and 1 for every finite linear predictor. The Bernoulli likelihood conditional on the random intercepts is the product of \(p_{ij}^{Y_{ij}}(1-p_{ij})^{1-Y_{ij}}\) over observed outcomes. The multilevel model accounts for dependence through the shared \(b_i\); treating all observations as independent without that cluster term uses a different likelihood and can misrepresent within-cluster similarity.
Diagnostics should assess whether the specified structure is credible. Check that the outcome is coded consistently as 0/1, that observed events occur across enough clusters to estimate between-cluster variation, and that the fitted model converges without warnings or extreme estimates. Compare observed and model-predicted event frequencies across clusters and across important predictor patterns. Large systematic discrepancies suggest an omitted predictor, an unsuitable functional form, or a random-intercept structure that does not capture the data. Very sparse events, empty outcome categories within many clusters, or near-perfect prediction can produce unstable estimates or separation. A normal distribution for random intercepts is an assumption to examine, not a guarantee that every cluster effect is well described by that distribution.
Alternatives, Limitations, and Common Mistakes
| Approach | What it represents | Main caution |
|---|---|---|
| Single-level logistic model | One common intercept and predictor effects, without a cluster random intercept. | May fail to represent within-cluster dependence or variation in baseline risk. |
| Random-intercept logistic model | Cluster-specific baseline log-odds, with common slopes in the basic form. | Depends on the random-effect distribution and assumes the included predictors and intercept structure are adequate. |
| Cluster fixed effects | A separate intercept for each observed cluster. | Can require many parameters, be unstable with sparse binary outcomes, and does not directly provide a random-effect distribution for new clusters. |
These approaches are not interchangeable merely because each can produce probabilities between 0 and 1. The choice should reflect the nesting, the scientific target, and the amount and distribution of information across clusters. A random-intercept model also has limits: it does not allow predictor effects to vary across clusters, and the fitted conditional model may not be compatible with every other conditional model used in a chained-equations system.
Common mistake: “The random intercept has mean zero, so the probability at \(b_i=0\) is the average probability across clinics.” The first clause describes the assumed mean of the random intercept; the conclusion does not follow because the logistic transformation is nonlinear. The population-average probability requires averaging the transformed probabilities over the random-effect distribution. For a particular known cluster, interpret the probability conditional on its cluster effect; for a population-average question, integrate over the distribution.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- A model has a treatment coefficient of \(0.60\). What is the conditional odds ratio for treatment, holding the other terms and cluster effect fixed?
- For a person, the linear predictor is \(-0.80\). Calculate the modeled event probability to three significant figures.
- Why is the probability at \(b_i=0\) generally not the population-average probability?
- Name one assumption of the random-intercept model that would be questionable if predictor slopes differed substantially across clusters.
Solutions. (1) The conditional odds ratio is \(\exp(0.60)=1.82\); the conditional odds are 1.82 times as high for the treated group at fixed values of the other terms. (2) \(p=\exp(-0.80)/\{1+\exp(-0.80)\}=0.4493/1.4493=0.310\), so the event probability is 31.0%. (3) The logistic function is nonlinear, so \(\operatorname{logit}^{-1}\{a+E(b_i)\}\) generally differs from \(E[\operatorname{logit}^{-1}(a+b_i)]\). (4) The basic random-intercept model assumes common predictor slopes; if slopes vary substantially by cluster, that assumption is not adequate.