linearities_cl: This function calculates the linearities in the negative...

View source: R/linearities.R

linearities_clR Documentation

This function calculates the linearities in the negative structure vector matrix X* for a cumulative link model, so the row vectors for which there is no separation. If this is an empty set or of length 0, then we have overlap.

Description

This function calculates the linearities in the negative structure vector matrix X* for a cumulative link model, so the row vectors for which there is no separation. If this is an empty set or of length 0, then we have overlap.

Usage

linearities_cl(y, X, rational = FALSE)

Arguments

y

the outcome variable. Can be factor, ordered, numeric, character or boolean. Works best if it is a factor or ordered factor. If it is not an (ordered) factor, we treat the outcome as nominal.

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

boolean flag whether rational arithmetic should be used. Default is FALSE.

Value

a list with elements $lins which lists the rows vectors that are linearities for any category and $index which gives the row index of the linearities. If there is complete separation they are both empty set. If their length/row dimension is number of categories*dim(X)[1], there is overlap. Anything in between is quasi-complete separation.


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