seprows_sl: Detect design matrix rows with separation for sequential...

View source: R/seprows.R

seprows_slR Documentation

Detect design matrix rows with separation for sequential (continuation-ratio) ordinal response models.

Description

Detect design matrix rows with separation for sequential (continuation-ratio) ordinal response models.

Usage

seprows_sl(y, X, rational = FALSE, reduce = TRUE)

detect_seprows_sl(y, X, rational = FALSE, reduce = TRUE)

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 internally coerce to ordered factor 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?

reduce

should the results be pooled over all categories? Defaults to TRUE.

Value

if reduce = TRUE a list with the list elements being a list of

  • offrows the submatrix of the matrix (X,y) with the rows responsible for separation over all categories

  • index the index of the rows responsible for separation over all categories

' if reduce = FALSE a list of lists with a list for each category listing offrows and index as above but category specific

Examples

data(qcsepdato)
y<-qcsepdato$y
X<-qcsepdato[,2:ncol(qcsepdato)]
seprows_sl(y,X)


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

Related to seprows_sl in divoRce...