detect_sepcols_acl: Identify separation columns in adjacent-category models

View source: R/detect_sepcols.R

detect_sepcols_aclR Documentation

Identify separation columns in adjacent-category models

Description

This function identifies the columns in a design matrix for an adjacent-category link model that have an infinite MLE, due to separation. Note this is due to separation which includes the case of a design matrix that doesn't have full rank.

Usage

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

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

Arguments

y

the outcome variable. Can be factor, ordered, numeric, character or boolean. Works best if it is an ordered factor, else we treat it alphanumerically ascending just as 'as.ordered'.

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 polynomials).

rational

boolean flag whether rational arithmetic should be used. Default is FALSE.

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.