| Title: | Goodness-of-Fit Tests for Ordinal Regression Models |
| Version: | 0.1.0 |
| Description: | Provides goodness-of-fit tests for ordinal regression models, including the Fagerland-Hosmer ordinal test, reproducing same output as 'Stata'. Supports polr(), vglm(), and binary glm() models. See Fagerland and Hosmer (2013) <doi:10.1002/sim.5645> and Fagerland and Hosmer (2017) <doi:10.1177/1536867X1701700308> for details. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Imports: | dplyr, magrittr, MASS, VGAM |
| Suggests: | spelling |
| Language: | en-US |
| URL: | https://github.com/Funto-Aladekomo/ordinalGOF |
| BugReports: | https://github.com/Funto-Aladekomo/ordinalGOF/issues |
| NeedsCompilation: | no |
| Packaged: | 2026-04-22 16:46:57 UTC; oluwafuntoaladekomo |
| Author: | Oluwafunto Aladekomo [aut, cre], Evan Kwiatkowski [aut] |
| Maintainer: | Oluwafunto Aladekomo <oluwafunto.a.aladekomo@uth.tmc.edu> |
| Repository: | CRAN |
| Date/Publication: | 2026-04-24 18:30:08 UTC |
Goodness-of-Fit Test for Ordinal Regression Models
Description
Tests the goodness of fit for ordinal regression models, reproducing
results equivalent to 'Stata's output. Supports models from polr(),
vglm(), and binary glm().
Usage
ordinalGOF(
model,
data,
catvars = NULL,
g = 10,
test = c("hl", "pr.chi2", "pr.dev", "lipsitz"),
ties = c("stata", "sorted", "equal"),
show_table = FALSE
)
Arguments
model |
A fitted model object. Supported classes: |
data |
A data frame used to fit the model. |
catvars |
Character vector of categorical variable names. Required only
when |
g |
Integer. Number of quantile groups (default: 10). |
test |
Character. The test to perform. One of |
ties |
Character. Tie-breaking method for grouping. One of
|
show_table |
Logical. If |
Value
An object of class htest containing:
- statistic
The chi-squared test statistic.
- parameter
Degrees of freedom.
- p.value
The p-value.
- method
A character string naming the test used.
Examples
library(MASS)
data(housing, package = "MASS")
m <- polr(Sat ~ Infl + Type + Cont, data = housing, Hess = TRUE)
ordinalGOF(m, data = housing, g = 5, test = "hl", ties = "stata")