
Native ordered logistic/probit regression (reproduces MASS::polr)
Source:R/mass_native.R
morie_polr.RdProportional-odds ordinal regression by direct maximum likelihood on
the cumulative-link parametrisation used by MASS::polr (same
cutpoint transform cumsum(c(theta_1, exp(theta_2..q))) and the
same glm-based start), so the fitted log-likelihood matches
MASS::polr to optimiser tolerance.
Examples
if (requireNamespace("MASS", quietly = TRUE)) {
set.seed(4)
n <- 250; x <- rnorm(n)
yc <- 1 + (runif(n) > plogis(-0.5 - x)) + (runif(n) > plogis(1 - x))
yf <- factor(pmin(yc, 3), levels = 1:3, ordered = TRUE)
fit <- morie_polr(yf ~ x, data = data.frame(yf, x))
fit$zeta
}
#>
#> -0.5717431 2.0922938