seprows_bcl: Identify the rows in the data matrix that cause separation in...

View source: R/seprows.R

seprows_bclR Documentation

Identify the rows in the data matrix that cause separation in baseline-category link categorical response models.

Description

This function checks which rows in X/Xstar are responsible for separation on any category. The observations need not separate the same categories.

Usage

seprows_bcl(y, X, rational = FALSE)

detect_seprows_bcl(y, X, rational = FALSE)

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 arithmetic be used?

Value

a list with elements:

  • offrows the submatrix of the matrix (X,y) with the rows responsible for separation on any category.

  • index the index of the rows responsible for separation.

Examples

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


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

Related to seprows_bcl in divoRce...