generalhoslem (version 1.3.4)

pulkrob: Pulkstenis-Robinson goodness of fit tests for ordinal response models.

Description

Performs the Pulkstenis-Robinson goodness of fit chi-squared and deviance tests for ordinal logistic regression models.

Usage

pulkrob.chisq(model, catvars)
pulkrob.deviance(model, catvars)

Arguments

model

an ordinal response model. Must be an object of class polr or clm.

catvars

a character vector containing the names of the categorical covariates.

Value

A list of class htest containing:

statistic

the chi-squared or deviance statistic.

parameter

degrees of freedom used.

p.value

the p-value.

method

a character string indicating the name of the test.

data.name

a character string indicating the model formula used.

observed

a cast generated data frame of observed frequencies.

expected

a cast generated data frame of expected frequencies.

stddiffs

a table of the standardised differences. See Hosmer, Lemeshow and Sturdivant (2013), p 162.

Details

The Pulkstenis-Robinson tests are goodness of fit tests for ordinal logistic regression models. They are capable of accommodating models with continuous as well as categorical predictors. The data are partitioned according to observed covariate patterns using the categorical covariates only. Any unobserved covariate patterns are discarded. Only categorical predictors are used to avoid partitioning among an unacceptably high number of covariate patterns. Each subject is assigned an ordinal response score by summing the predicted probabilities of each subject for each outcome level multiplied by equally spaced integer weights. The covariate patterns are then split into two at the median score within each.

Based on this partitioning, observed and expected frequencies are calculated and the test statistic computed. This statistic is distributed by the chi-squared distribution with \((2I - 1)(J - 1) - k - 1\) degress of freedom, where I is the number of covariate patterns, J is the number of of response categories and k is the number of categorical variables in the model.

It is recommended (Fagerland and Hosmer, 2016) that the Pulkstenis-Robinson tests be run alongside the Hosmer-Lemeshow test (logitgof) and the Lipsitz test (lipsitz.test).

References

  • Fagerland MW, Hosmer DW. Tests for goodness of fit in ordinal logistic regression models. Journal of Statistical Computation and Simulation 2016. DOI: 10.1080/00949655.2016.1156682.

  • Hosmer DW, Lemeshow S, Sturdivant RX. Applied Logistic Regression, 3rd Edition. 2013. New York, USA: John Wiley and Sons.

  • Pulkstenis E, Robinson TJ. Goodness-of-fit tests for ordinal response regression models. Statistics in Medicine 2004;23:999-1014.

See Also

logitgof, lipsitz.test.

Examples

Run this code
# NOT RUN {
data(mtcars)

# using polr
mod1 <- polr(as.factor(gear) ~ mpg + cyl + vs, data = mtcars)
pulkrob.chisq(mod1, c("vs"))
pulkrob.deviance(mod1, c("vs"))

# using clm - ensure outcome variable is a factor before fitting the model
library(ordinal)
mtcars$gear <- as.factor(mtcars$gear)
mod2 <- clm(gear ~ mpg + cyl + vs, data = mtcars)
pulkrob.chisq(mod2, c("vs"))
pulkrob.deviance(mod2, c("vs"))
# }

Run the code above in your browser using DataLab