Why a Random Intercept Is Not a General Remedy
A random intercept represents differences in baseline outcome propensity across clusters. It shifts every linear predictor in a cluster by the same amount, while fixed effects describe how predictors relate to the outcome. That distinction matters when a predictor separates the observed outcomes: a cluster-specific shift does not necessarily undo the pattern in the fixed-effect predictors.
A binary random-intercept model can therefore have a fixed-effect coefficient with no finite maximum-likelihood estimate. The issue is not simply that the fitted probabilities are extreme or that an optimizer has difficulty. For some data patterns, the likelihood itself keeps increasing as a fixed-effect coefficient moves farther in a separating direction. A random intercept models clustering; it does not guarantee overlap in the predictor data.
To say that a fixed-effect design has complete separation, code the observed outcomes as \(s_{ij}=2Y_{ij}-1\), so \(s_{ij}\) is either \(1\) or \(-1\). Complete separation occurs if there is a fixed-effect direction \(\boldsymbol{\delta}\) such that \(s_{ij}\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\delta}>0\) for every observation. Moving the fixed effects along that direction makes every observed outcome increasingly likely in the ordinary logistic model.
The random-intercept version has the same basic vulnerability. For any finite \(B_j\), adding \(t\boldsymbol{\delta}\) to the fixed effects changes the linear predictor to \(\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+t\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\delta}+B_j\). If the separating inequalities are strict, the fixed-effect term eventually dominates any finite random-intercept value. Thus, conditional probabilities for the observed outcomes approach one as \(t\) increases.
Why the Marginal Likelihood Can Also Fail to Attain a Maximum
The marginal likelihood does not condition on estimated cluster intercepts. Instead, it averages each cluster's conditional likelihood over the assumed distribution of \(B_j\). This integration can change likelihood values and estimates, but it does not automatically remove a separating direction.
For fixed, finite \(\sigma\), a normal random intercept is finite with probability one. Along a strict separating direction, the conditional probability of the observed outcome pattern approaches one for every finite vector of random intercepts. The conditional likelihood is bounded between zero and one, so the dominated convergence theorem allows the limit to pass through the integration. The marginal likelihood can consequently approach one as well. At any finite fixed-effect value, every Bernoulli probability is strictly between zero and one, so the likelihood of a nonempty data set is less than one. The likelihood supremum is not attained at a finite fixed-effect value.
Check whether a linear combination of the fixed-effect predictors orders every observed success above every observed failure, in the strict sense defined above.
Within a cluster, the same \(B_j\) is added to each observation. It cannot change the ordering induced by a fixed-effect contrast between two observations in that cluster.
If the strict separating direction makes the conditional likelihood tend to one for every finite random-intercept vector, integrating over the normal distribution does not create a finite maximizing coefficient.
Worked Example: A Predictor Separates Outcomes Within Every Cluster
Suppose three hypothetical clinics each contribute two observations. In each clinic, the observation with \(x=0\) has \(Y=0\), and the observation with \(x=1\) has \(Y=1\). Fit a random-intercept logistic model with a fixed intercept \(\beta_0\) and a fixed slope \(\beta_1\).
| Clinic | \(x\) | \(Y\) |
|---|---|---|
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 0 | 0 |
| 2 | 1 | 1 |
| 3 | 0 | 0 |
| 3 | 1 | 1 |
For a positive number \(a\), take \(\beta_0=-a\) and \(\beta_1=2a\). Conditional on a clinic intercept \(B_j=b\), the linear predictors are \(-a+b\) for the failure and \(a+b\) for the success. For every finite \(b\), the failure probability tends to one and the success probability tends to one as \(a\) grows.
For a numerical check at \(b=0\), set \(a=3\). The fitted success probability at \(x=0\) is \(\operatorname{expit}(-3)=0.04743\), so the observed failure probability is \(1-0.04743=0.9526\). At \(x=1\), the success probability is \(\operatorname{expit}(3)=0.9526\). The conditional probability of the two observed outcomes in one clinic is therefore \(0.9526^2=0.9074\); for all three clinics it is \(0.9074^3\approx0.747\). This is a conditional calculation at \(b=0\), not the marginal likelihood.
As \(a\) increases without bound, the conditional likelihood approaches one for every finite set of clinic intercepts. Integrating over normally distributed intercepts preserves that limit, so the marginal likelihood approaches one without attaining it at any finite \(\beta_0,\beta_1\). The random intercept has not repaired the fixed-effect separation.
Sparse Factor Levels Can Have the Same Problem
Separation need not involve a continuous predictor or perfectly ordered values across an entire data set. A factor level represented only by successes can make its coefficient increase indefinitely. If the other observations have factor value zero, increasing the coefficient for the all-success level raises the likelihood of those successes without changing the linear predictors for the other observations.
In a random-intercept model, this reasoning applies within each cluster as well as after integration. If every observation at the sparse level is a success, then, for any fixed finite nuisance parameters and any finite \(B_j\), increasing that level's coefficient increases the conditional probability of the observed outcomes. Integrating a strictly increasing likelihood contribution over the random-intercept distribution preserves the increase. The intercept can shift the baseline, but it cannot create failures at that factor level.
Worked Example: A Factor Level With Only Successes
Consider two hypothetical clinics. Each has one \(z=0\) success, one \(z=0\) failure, and one \(z=1\) success; there are no \(z=1\) failures. Use a fixed intercept \(\beta_0=0\) and a coefficient \(\beta_z\) for \(z\). For a clinic with \(B_j=b\), the probability of its observed outcomes is \(\operatorname{expit}(b)\{1-\operatorname{expit}(b)\}\operatorname{expit}(\beta_z+b)\).
At \(b=0\), the two \(z=0\) outcomes contribute \(0.5(1-0.5)=0.25\). If \(\beta_z=0\), the \(z=1\) success contributes \(0.5\), giving \(0.25(0.5)=0.125\) per clinic and \(0.125^2=0.01563\) for two clinics. If \(\beta_z=\log(9)=2.197\), then \(\operatorname{expit}(\beta_z)=0.9\), giving \(0.25(0.9)=0.225\) per clinic and \(0.225^2=0.05063\) for both.
These numbers are conditional likelihood values at \(b=0\), not marginal likelihood values. But the direction of change also holds for every finite \(b\): the \(z=0\) factors are unchanged, and the \(z=1\) success probability increases toward one. Therefore the integrated likelihood increases toward a limit as \(\beta_z\) tends to infinity, with no finite maximizing value for that coefficient when the other parameters are held fixed. The random intercept does not supply the missing \(z=1\) failures.
When Within-Cluster Overlap Changes the Diagnosis
The presence of a random intercept is not, by itself, evidence either for or against separation. The observed predictor-outcome patterns matter. In particular, outcomes that go both ways at the same fixed-effect predictor values prevent a strict fixed-effect direction from correctly classifying every observation at those values.
Worked Example: Opposite Outcomes at the Same Predictor Values
In each of two hypothetical clinics, observe one success and one failure at \(x=0\), and one success and one failure at \(x=1\). For any fixed-effect intercept and slope, the two observations at a given \(x\) in a clinic have the same linear predictor, since they also share the same \(B_j\). Their outcomes are opposite, so that predictor value cannot assign both observations probabilities tending to one.
For illustration, take \(B_j=0\), \(\beta_0=0\), and \(\beta_1=\log(3)=1.099\). At \(x=0\), the success-failure pair contributes \(0.5(1-0.5)=0.25\). At \(x=1\), the success probability is \(0.75\), so the pair contributes \(0.75(1-0.75)=0.1875\). One clinic's conditional likelihood is \(0.25(0.1875)=0.04688\); for two clinics it is \(0.04688^2\approx0.002197\). These values are not a marginal fit, but they show why driving the slope upward cannot make both outcomes at a shared predictor value nearly certain.
This pattern does not establish that every model parameter has a well-behaved estimate: sparse data, a misspecified model, or other estimation problems may remain. It does show why one should diagnose the actual design and outcome pattern rather than conclude that any apparent cluster-level split guarantees fixed-effect separation.
Diagnostics, Comparisons, and Limitations
A useful diagnostic starts with the data pattern, not the optimizer's final coefficient alone. Review outcome counts at each factor level, the range of continuous predictors among successes and failures, and whether those patterns persist within clusters. A predictor that orders outcomes in the same direction within many clusters is a particularly direct warning: adding one intercept shift per cluster leaves that within-cluster ordering intact.
Then inspect the fitting output. Very large fixed-effect estimates, large standard errors, warnings about convergence, and extreme fitted probabilities can accompany separation. These are warning signs, not proofs: convergence problems and sparse information can have other causes. Conversely, an optimizer reporting convergence does not establish that a finite maximum exists. The likelihood reasoning and the observed data pattern must also be considered. The earlier material on convergence diagnostics and separation provides broader checks; the central point here is to ask whether a fixed-effect separating pattern remains after considering the cluster structure.
| Approach | What it represents | What it does not guarantee |
|---|---|---|
| Ordinary logistic regression | Fixed effects for independent binary observations | It does not account for within-cluster dependence; separation can still prevent finite estimates. |
| Random-intercept logistic GLMM | Cluster-specific baseline shifts with a specified random-intercept distribution | It does not guarantee predictor overlap or finite fixed-effect estimates. |
| Changing the fixed-effect design | A revised predictor specification informed by the scientific question and observed data | It is not a mechanical cure; removing or combining terms can change the question being estimated. |
The random-intercept model also relies on substantive assumptions: conditional independence given the random intercept and covariates, a suitable random-intercept distribution, and an appropriate fixed-effect specification. Separation is a property of the observed outcome and design pattern; adding a normal random effect does not make those assumptions unnecessary. Nor should one infer that a large coefficient represents a well-estimated, precisely quantified effect. A diverging estimate indicates that ordinary maximum likelihood has not supplied a finite value for that coefficient.
Common Mistake
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In a random-intercept logistic model, what happens to the within-cluster linear-predictor contrast between two observations when the shared intercept is added?
- In a hypothetical data set, a binary predictor equals one only for observations with \(Y=1\). Why might its coefficient lack a finite maximum-likelihood estimate even with random intercepts?
- At \(B_j=0\), an observation has linear predictor \(\eta=2\). Calculate its success probability and failure probability. Explain why this calculation alone is not a marginal likelihood.
- Every cluster has successes and failures at both \(x=0\) and \(x=1\). Does this establish that the full GLMM has finite estimates? What does it tell you about strict separation by \(x\)?
Solutions. (1) The contrast is unchanged: \((\mathbf{x}_{ij}^{\mathsf T}\boldsymbol{\beta}+B_j)-(\mathbf{x}_{kj}^{\mathsf T}\boldsymbol{\beta}+B_j)=(\mathbf{x}_{ij}-\mathbf{x}_{kj})^{\mathsf T}\boldsymbol{\beta}\). (2) Increasing the coefficient raises the fitted probability for those successes without changing the other observations' predictors; integrating over finite random intercepts does not create failures at that level. (3) \(P(Y=1\mid B_j=0)=\operatorname{expit}(2)=0.8808\) and \(P(Y=0\mid B_j=0)=1-0.8808=0.1192\). This conditions on one intercept value; a marginal likelihood integrates over the distribution of \(B_j\). (4) No. Other estimation problems may remain, but opposite outcomes at the same predictor values prevent \(x\) from strictly separating every observation in that design pattern.