seprows_b: Identify rows in the data matrix that cause separation for...

View source: R/seprows.R

seprows_bR Documentation

Identify rows in the data matrix that cause separation for binary models.

Description

This function checks which rows in X cause the separation (or none).

Usage

seprows_b(y, X, rational = FALSE)

detect_seprows_b(y, X, rational = FALSE)

Arguments

y

the binary outcome variable. Works best if it is a factor or ordered factor but can also be numeric, boolean or character. We coerce to factor internally.

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

  • index the index of the rows responsible for separation

'

Examples

data(csepdat1)
y<-csepdat1$y
X<-cbind(1,csepdat1[,2:ncol(csepdat1)])
seprows_b(y,X) #separation

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

Related to seprows_b in divoRce...