detect_sepcols_b: Identify separation columns for binary models

View source: R/detect_sepcols.R

detect_sepcols_bR Documentation

Identify separation columns for binary models

Description

This function identifies the columns in a binary model design matrix that are responsible for separation.

Usage

detect_sepcols_b(
  y,
  X,
  rational = FALSE,
  backend = c("rcdd", "ROI"),
  solver = NULL
)

sepcols_b(y, X, rational = FALSE, backend = c("rcdd", "ROI"), solver = NULL)

Arguments

y

the dependent variable. Must be binary. If we encounter a factor, we use the levels of the factor and thus also the specified reference. For anything else, we use the lowest alphanumeric category as reference.

X

a design matrix, e.g. generated via a call to 'model.matrix'. This means we expect that X already contains the desired contrasts for factors (e.g., dummies) and any other expanded columns (e.g., for polynominals).

rational

should rational arithmetic be used.

backend

which backend to use for the linear program. Can be "rcdd" (default and only option for rational=TRUE) or "ROI".

solver

the solver to be used in the backend. Defaults to "DualSimplex" for "rcdd" and the first LP solver returned by 'ROI_applicable_solver()' for "ROI".

Details

We solve a linear program in this function that operates only on y and X, so without a specific model. This program corresponds to detecting which columns in the design matrix leads to infinite MLE for some link functions, but it is more general as there are links that can still give finite estimates even though there is separation. Hence this function detects separation even in the case of (seemingly) finite estimates or if there is no warning. The prime example is using the log link in logistic regression.


divoRce documentation built on April 28, 2026, 3:01 a.m.