UCLA Statistical Consulting Example

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This vignette replicates the ordinal logistic regression example done by the UCLA Statistical Consulting Group. It demonstrates how to use the pomcheckr package to check if the proportional odds assumption holds.

Load packages and data

library(pomcheckr)
library(ggplot2)
data(ologit)

Description of Data

head(ologit)

ologit is a synthetic data set consisting of the following:

Descriptive Statistics

Some of the descriptive statistics from the example are repeated below.

## one at a time, table apply, pared, and public
lapply(ologit[, c("apply", "pared", "public")], table)
## three way cross tabs (xtabs) and flatten the table
ftable(xtabs(~ public + apply + pared, data = ologit))
ggplot(ologit, aes(x = apply, y = gpa)) +
  geom_boxplot() +
  geom_jitter(size=0.1, alpha = .5) +
  facet_grid(pared ~ public, margins = TRUE) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1))

Analysis

The source page describes various analysis methods that one might consider and what the limitations are with respect to this data set. Since the outcome apply is an ordered, categorical variable an ordered logistic (aka cumulative logit) model is an appropriate choice.

Proportional Odds Assumption

A key assumption of an ordinal logistic regression is that the odds of adjacent categories are proportional (i.e., the slope coefficients are the same). The score test is sometimes used to test this assumption, but it tends to be conservative and rejects the null more often than it should. The source page illustrates a graphical method for checking this assumption, and pomcheckr will automatically generate the necessary plots.

plot(pomcheck(apply ~ pared + public + gpa, data=ologit))

The basic idea is a series of binary logistic regressions without the parallel slopes assumption are run on the response against the predictors. Then we check for equality of the slope coefficients across levels of the predictor (or cutpoints if the predictor is continuous). See the source page for further details.

In the above plots, the slope coefficients are roughly equal for both pared and gpa. However, the plot for public suggests the parallel slopes assumption is not satisfied for that predictor.



Try the pomcheckr package in your browser

Any scripts or data that you put into this service are public.

pomcheckr documentation built on June 6, 2021, 9:06 a.m.