Tutorials › Generalized Linear Mixed Models (GLMM) › Geometric Separation in the Design Matrix

Separation in Binary Outcomes · Tutorial 326 of 698

Geometric Separation in the Design Matrix

You will translate observed binary outcomes into signed design rows, identify complete and quasi-complete separation geometrically, and understand the special role of observations whose projection is zero.

Advanced 12 min read

What You'll Learn

  • Define complete and quasi-complete separation using signed rows of the fixed-effects design matrix.
  • Interpret the separating direction as a hyperplane condition in predictor space.
  • Explain why zero projections allow quasi-complete separation but prevent strict separation.
  • Derive how a separating direction changes the conditional and marginal likelihood.
  • Distinguish separation from overlap patterns and from an optimizer’s failure to converge.

From Outcomes to Geometry

For a binary GLMM, the fixed-effects part of the linear predictor is \(x_i^\mathsf{T}\beta\), where \(x_i^\mathsf{T}\) is row \(i\) of the fixed-effects design matrix \(X\), and \(\beta\) is the fixed-effects coefficient vector. With a logit link, a common conditional model is \(\operatorname{logit}\{P(Y_i=1\mid b)\}=x_i^\mathsf{T}\beta+z_i^\mathsf{T}b\). Here \(b\) denotes the random effects, \(z_i\) is the corresponding random-effects design row, and observations are conditionally independent given \(b\). The geometric conditions below concern \(X\) and the observed binary outcomes; they do not require the random-effects design to have the same columns.

The key idea is to ask whether some coefficient direction moves the linear predictors in the correct direction for every observed outcome. Encode that direction using a signed design row:

$$ a_i=(2y_i-1)x_i, \qquad m_i=a_i^\mathsf{T}d=(2y_i-1)x_i^\mathsf{T}d, $$

where \(y_i\in\{0,1\}\) and \(d\) is a proposed direction in fixed-effects coefficient space. If \(y_i=1\), then \(m_i>0\) means that \(d\) increases the fixed linear predictor for that observation. If \(y_i=0\), then \(m_i>0\) means that \(d\) decreases it. Either change moves the fitted probability toward the observed outcome.

Definition: The observed data are completely separated by the fixed-effects design if there is a vector \(d\) such that \(m_i>0\) for every observation. They are quasi-completely separated if there is a vector \(d\) such that \(m_i\geq 0\) for every observation and \(m_i>0\) for at least one observation. Thus, quasi-complete separation permits some zero projections, but no negative projections. A vector with \(m_i=0\) for every observation is not a separating direction.

Geometrically, the rows \(x_i\) are points in a \(p\)-dimensional design space. The equation \(x^\mathsf{T}d=0\) describes a hyperplane through the origin in that space. For a model with an intercept, its intercept coordinate allows this condition to represent an affine boundary in the predictor coordinates. Complete separation places every observed row strictly on the outcome-appropriate side. Quasi-complete separation permits some rows to lie on the boundary, while every row off the boundary is on the appropriate side.

Why Zero Projections Matter

A zero projection is not a minor exception to the definition. Along the coefficient path \(\beta(t)=\beta_0+td\), an observation with \(x_i^\mathsf{T}d=0\) has a linear predictor that does not change with \(t\). If the observation is on the boundary, its probability is not driven toward zero or one by this direction. This blocks complete separation, which requires every observed outcome to be driven in the correct direction. It does not block quasi-complete separation if the other observations have positive signed projections.

In particular, if the same design row occurs with both outcomes, strict separation is impossible: its projection cannot be strictly positive for both signs of \(2y_i-1\). But both observations can have zero projection, so quasi-complete separation may still hold. The earlier material on Overlap and Finite Fixed-Effect Estimates provides a useful conceptual contrast, with this distinction made explicit: overlap rules out strict separation at that row, not necessarily quasi-complete separation.

Worked Example: Strict Separation by a Slope Direction

Suppose a hypothetical binary data set has an intercept and one predictor \(x\), with observations \((x,y)=(-2,0),(-1,0),(1,1),(2,1)\). The design rows are \(x_i^\mathsf{T}=(1,x_i)\). Test the direction \(d=(0,1)^\mathsf{T}\), which increases the slope coefficient without changing the intercept.

For the two \(y=0\) observations, \(m_i=-x_i^\mathsf{T}d=-x_i\), giving margins \(2\) and \(1\). For the two \(y=1\) observations, \(m_i=x_i^\mathsf{T}d=x_i\), giving margins \(1\) and \(2\). All four margins are strictly positive, so the data are completely separated.

Along \(\beta(t)=\beta_0+td\), each fixed linear predictor changes by \(t x_i^\mathsf{T}d\). The slope direction therefore moves the fitted probabilities toward zero for both observed zeros and toward one for both observed ones. This conclusion uses the actual design rows and outcomes, not merely a visual impression that the predictor values differ by group.

Worked Example: Boundary Observations and Quasi-Complete Separation

Consider the hypothetical observations \((-1,0),(0,0),(0,1),(1,1)\), again with design rows \(x_i^\mathsf{T}=(1,x_i)\). Use \(d=(0,1)^\mathsf{T}\). The signed margins are \(1,0,0,1\): the observation at \(x=-1\) with \(y=0\) has margin \(-(-1)=1\); both observations at \(x=0\) have margin zero; and the observation at \(x=1\) with \(y=1\) has margin \(1\). No margin is negative and at least one is positive. The data are quasi-completely separated, not completely separated.

The two outcomes at \(x=0\) prevent strict separation because their design rows are identical. Yet they do not prevent a quasi-separating direction: the slope direction leaves both boundary observations unchanged while moving the other two observations in the correct direction.

For an arithmetic illustration, set the intercept to zero and consider the ordinary fixed-effects logistic likelihood along \(\beta(t)=(0,t)^\mathsf{T}\). The two boundary observations each contribute \(1/2\); the other two each contribute \(\operatorname{logit}^{-1}(t)\). Thus \(L(t)=0.25\{\operatorname{logit}^{-1}(t)\}^2\). At \(t=0\), \(L(0)=0.25(0.5)^2=0.0625\). At \(t=2\), \(\operatorname{logit}^{-1}(2)=1/(1+e^{-2})\approx0.8808\), so \(L(2)=0.25(0.8808)^2\approx0.1940\). As \(t\) tends to infinity, the two non-boundary contributions tend to one, while the boundary contributions remain \(1/2\) each; hence \(L(t)\) tends to \(0.25\). This is a fixed-effects logistic illustration of the geometry, not a calculation of a GLMM’s marginal likelihood.

Likelihood Justification

The geometry explains why separation is associated with fixed-effect estimates that can move without reaching a finite maximum. For fixed \(b\), write the conditional success probability as \(p_i(t)=\operatorname{logit}^{-1}\{x_i^\mathsf{T}(\beta_0+td)+z_i^\mathsf{T}b\}\). The probability assigned to the observed outcome is \(q_i(t)=p_i(t)\) if \(y_i=1\), and \(q_i(t)=1-p_i(t)\) if \(y_i=0\). Its signed margin \(m_i\) is constant along the path.

$$ \frac{d}{dt}\log q_i(t)=m_i\{1-q_i(t)\}. $$

To verify the expression, when \(y_i=1\), the derivative is \(x_i^\mathsf{T}d\{1-p_i(t)\}=m_i\{1-q_i(t)\}\). When \(y_i=0\), it is \(-x_i^\mathsf{T}d\,p_i(t)=m_i\{1-q_i(t)\}\), because then \(m_i=-x_i^\mathsf{T}d\) and \(1-q_i(t)=p_i(t)\). Therefore a positive margin makes the observed-outcome probability increase; a zero margin leaves it unchanged.

For the conditionally independent Bernoulli observations, the conditional likelihood is the product of the \(q_i(t)\). Its log derivative is the sum of the nonnegative terms above, and is strictly positive whenever at least one margin is positive. Under complete separation, every \(q_i(t)\) tends to one. Under quasi-complete separation, positive-margin contributions tend to one, while zero-margin contributions remain unchanged along this direction.

The same monotonicity applies to the marginal GLMM likelihood when the random-effects distribution is held fixed: for each \(b\), the conditional likelihood increases along the direction; integrating over \(b\) preserves that ordering. The conditional likelihood is bounded by one, so its marginal integral is also bounded by one. This gives a likelihood justification for the geometric diagnostic without asserting that every GLMM’s marginal likelihood has the same numerical limit as the fixed-effects illustration above.

Worked Example: A Pattern With No Separating Direction

Suppose a hypothetical data set has \((x,y)=(-1,0),(0,1),(1,0)\) and design rows \((1,x)\). Let \(d=(d_0,d_1)^\mathsf{T}\). The three signed margins are \(m_1=-d_0+d_1\), \(m_2=d_0\), and \(m_3=-d_0-d_1\).

For either complete or quasi-complete separation, all three margins must be nonnegative. The middle margin requires \(d_0\geq0\), while the first and third require \(d_1\geq d_0\) and \(d_1\leq-d_0\). Together these imply \(d_0\leq0\), so \(d_0=0\), and then \(d_1=0\). This leaves all margins zero, which is not a separating direction. Hence neither form of separation holds for this design and outcome pattern.

This example also shows why checking whether a single predictor looks “large” for one outcome group is insufficient. The relevant question is whether one coefficient direction satisfies all the signed inequalities simultaneously.

Checking the Geometry in Practice

The definitions provide an exact criterion for a fixed design matrix and observed outcomes. In practice, first construct or inspect the design matrix as it was actually fitted: include its intercept, factor-contrast columns, interactions, and any transformations. Then evaluate whether a direction can satisfy the signed inequalities. A plot of one predictor can reveal an obvious pattern, but it cannot generally settle the question when several columns jointly define the separating direction.

A few checks help prevent misleading conclusions:

  • Check the sign convention. For \(y_i=0\), the desired direction is a decreasing predictor, which is why its signed row is \(-x_i\).
  • Check boundary rows separately. A zero margin is allowed for quasi-complete separation, but not for complete separation. It is not evidence of a strictly separated observation.
  • Check that at least one margin is positive. The zero vector always gives zero margins and must not be mistaken for quasi-complete separation.
  • Use the fitted design coding. Releveling a factor or changing contrasts changes the coordinates of \(X\), although a nonsingular reparameterization preserves whether a separating direction exists.

A convergence warning alone does not establish separation: numerical scaling, weak identification, or other optimization difficulties can also cause trouble. Conversely, a successful optimizer termination does not disprove a geometric separating direction. The condition is about the observed design and labels; optimization diagnostics describe the behavior of a particular fitting procedure.

Interpretation and Limitations

The geometric criterion is a statement about fixed-effects directions in the specified binary model. It is useful because it makes the distinction between strict and boundary separation precise and can be checked independently of an optimizer’s path. Its conclusion is still conditional on the model specification and observed data. A different set of columns, a changed outcome coding, or a different sample can change the geometry.

The criterion should not be confused with a claim that every coefficient is individually separated, or that every coefficient estimate must diverge at the same rate. It identifies a direction along which the likelihood improves; it does not by itself describe all parameter directions or quantify uncertainty. Nor should the simple fixed-effects likelihood numbers in the boundary example be transferred to a GLMM with random effects: marginal likelihoods depend on the random-effects distribution and design.

A common mistake is to reason, “Both outcomes occur at \(x=0\), so there is overlap; therefore there can be no separation of any kind.” The correction is that identical rows with opposite outcomes rule out a direction strictly positive for every observation. They can both have zero projection, leaving the remaining rows to satisfy the quasi-complete inequalities. Another mistake is to count a direction with all zero projections as quasi-complete separation; the definition requires at least one strict margin.

Key takeaway: Multiply each fixed-effects design row by \(2y_i-1\). Complete separation requires a direction with every signed projection strictly positive; quasi-complete separation requires every projection nonnegative and at least one positive. Zero projections are precisely the boundary cases that distinguish these conditions.

Check Your Understanding

For each question, give your answer and check the brief solution that follows it.

  1. For \(y=0\) and a design row \(x^\mathsf{T}\), what signed row is used, and what does a positive projection mean?
    Solution: The signed row is \(-x^\mathsf{T}\). A positive projection means the direction decreases the linear predictor, moving the fitted probability toward the observed zero.
  2. If all signed margins are nonnegative but exactly one is positive, is the pattern completely separated, quasi-completely separated, or neither?
    Solution: It is quasi-completely separated. The zero margins prevent complete separation, and the positive margin satisfies the requirement that at least one observation be strictly separated.
  3. Two observations have the same design row, one with \(y=0\) and one with \(y=1\). What form of separation does this rule out at that row, and what form might remain possible?
    Solution: It rules out strict positivity for both observations, so complete separation is impossible. Both margins can be zero, so quasi-complete separation may remain possible if the other rows satisfy the required inequalities and at least one has a positive margin.
  4. For signed margins \(m=(-2,0,3)\), does the proposed direction establish quasi-complete separation?
    Solution: No. The negative margin violates the requirement that every margin be nonnegative, even though one margin is positive.
  5. Why does the zero direction \(d=0\) not establish quasi-complete separation?
    Solution: It gives \(m_i=0\) for every observation. Quasi-complete separation requires at least one strictly positive margin.
Clinical Biostats