diagsep_cl: Detailed separation diagnostic for cumulative link ordinal...

View source: R/diagsep.R

diagsep_clR Documentation

Detailed separation diagnostic for cumulative link ordinal response 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_cl(y, X, rational = FALSE, backend = c("rcdd", "ROI"), solver = NULL)

Arguments

y

the ordinal outcome variable. Works best if it is an ordered factor but can also be numeric, boolean or character. In the latter case we corece to ordered factor and interpret the ordering as alphanumerically increasing (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 arithemtic 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, the ones which are not linearities (note that individual observations can be duplicated in the cone as they may lie on the boundary)

  • 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(qcsepdato)
y<-qcsepdato$y
X<-qcsepdato[,2:ncol(qcsepdato)]
diagsep_cl(y,X)


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

Related to diagsep_cl in divoRce...