diagsep_bcl: Detailed separation diagnostic for baseline-category link...

View source: R/diagsep.R

diagsep_bclR Documentation

Detailed separation diagnostic for baseline-category link models.

Description

This function checks whether there is (quasi-) complete separation, which type if any, gives the dimension of the recession cone, lists the number of columns in the design matrix that give rise to the separation as well as the columns names and lists the rows in X for which we have separation.

Usage

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

Arguments

y

the nominal outcome variable. Works best if it is a factor but can also be numeric, boolean or character. In the case of the latter we coerce to factor and the lowest alphanumeric entry is used as reference (just as 'as.ordered' is doing).

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

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".

Value

an object of class 'sepmod' that is a list with the components:

  • separation boolean whether there is separation ('TRUE' means separation)

  • septype which type of separation (or not). A string of either "Overlap", "Quasi-Complete Separation" or "Complete Separation".

  • reccdim dimension of recession cone

  • offrows offending rows in X

  • nr.offcols number of columns of the design matrix that have separation

  • offcols columns of the design matrix that have separation. It is given as category::effect.

Examples

data(qcsepdatm)
y<-qcsepdatm$y
X<-qcsepdatm[,2:ncol(qcsepdatm)]
diagsep_bcl(y,X)


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

Related to diagsep_bcl in divoRce...