ordreg: Ordered regression

View source: R/ordreg.R

ordregR Documentation

Ordered regression

Description

Maximum-likelihood estimation of a model for which the response is ordinal

Usage

ordreg(
  formula,
  data,
  weights,
  subset,
  na.action,
  offset,
  contrasts = NULL,
  link = c("probit", "logit", "cloglog"),
  start = NULL,
  opt = c("bfgs", "nr", "newton"),
  maxit = 100,
  trace = 0,
  check_gradient = FALSE,
  ...
)

## S3 method for class 'ordreg'
fitted(object, ..., type = c("outcome", "probabilities"))

Arguments

formula

a symbolic description of the model

data

a data frame

subset, weights, na.action, offset, contrasts

see lm

link

one of probit and logit

start

a vector of starting values,

opt

optimization method

maxit

maximum number of iterations

trace

printing of intermediate result

check_gradient

if TRUE the numeric gradient and hessian are computed and compared to the analytical gradient and hessian

...

further arguments

object

a ordreg object

type

one of "outcome" or "probabilities" for the fitted method

Value

an object of class micsr, see micsr::micsr for further details.

Examples

mod1 <- ordreg(factor(dindx) ~ rhs1 + catchup, fin_reform, link = "logit")
library(survival)
ud <- transform(unemp_duration, years = floor(duration / 365))
ud <- transform(ud, years = ifelse(years == 6, 5, years))
mod2 <- ordreg(Surv(years, censored == "no") ~ gender + age + log(1 + wage), ud,
               link = "cloglog", opt = "bfgs")

micsr documentation built on June 8, 2025, 9:31 p.m.