Fit a threshold-specific cumulative-logit ordinal regression
Source:R/mrm_primitives_ordinal.R
mrm_threshold_specific_ordinal.RdFor each cumulative cutpoint \(k = 1, \ldots, K-1\), fits an independent logistic regression of \(1\{Y \le k\}\) on the covariates. Optionally fits the proportional-odds baseline and returns the likelihood-ratio test of PO vs. threshold-specific.
Usage
mrm_threshold_specific_ordinal(
data,
outcome_col,
covariate_cols,
ordinal_levels = NULL,
fit_proportional_odds_first = TRUE,
max_iter = 200L,
tol = 1e-06
)Arguments
- data
data.frame, one row per unit.
- outcome_col
Character; name of the ordinal outcome column. Either an ordered factor / integer code or a character column (in which case
ordinal_levelsshould be passed explicitly).- covariate_cols
Character vector of predictor columns. Categorical predictors should be one-hot dummied before passing.
- ordinal_levels
Optional character vector giving the explicit ordering of the outcome categories (low-to-high). If
NULLand the outcome is a factor,levels()is used; otherwisesort(unique())(rarely what you want – pass this).- fit_proportional_odds_first
Logical; if
TRUE(default) the proportional-odds baseline is fit and an LR test against the threshold-specific model is reported.- max_iter, tol
IRLS / GLM control passed to
glm.fit.