cosmic: Conditional Ordinal Stereotype Model for Incident-Level Comparison

Implements the Conditional Ordinal Stereotype Model for Incident-Level Comparison (COSMIC), a method for analyzing ordinal outcomes observed across multiple actors within shared events. The model uses a conditional likelihood to remove event-level confounding and estimate actor-specific propensities relative to their peers. Efficient computation is achieved via a dynamic programming algorithm for the Poisson-multinomial normalization term, enabling scalable estimation with Markov chain Monte Carlo. The package provides tools for data preparation, model fitting using Stan, and extraction of posterior summaries for comparative inference. Estimation of police officer propensity to escalate force is the primary motivation for the model. For more details see Ridgeway (2026) "A Conditional Ordinal Stereotype Model to Estimate Police Officers’ Propensity to Escalate Force" <doi:10.1080/01621459.2025.2597050>.

Version: 0.5
Depends: R (≥ 4.1.0)
Imports: dplyr, posterior, stats
Suggests: arrangements, cmdstanr (≥ 0.9.0), future, future.apply, ggplot2, kableExtra, knitr, MASS, progressr, rmarkdown, testthat (≥ 3.0.0), xtable
Published: 2026-05-04
DOI: 10.32614/CRAN.package.cosmic (may not be active yet)
Author: Greg Ridgeway [aut, cre]
Maintainer: Greg Ridgeway <gridge at upenn.edu>
License: MIT + file LICENSE
NeedsCompilation: no
Additional_repositories: https://stan-dev.r-universe.dev
CRAN checks: cosmic results

Documentation:

Reference manual: cosmic.html , cosmic.pdf
Vignettes: Introduction to cosmic (source, R code)

Downloads:

Package source: cosmic_0.5.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): not available, r-release (x86_64): not available, r-oldrel (x86_64): not available

Linking:

Please use the canonical form https://CRAN.R-project.org/package=cosmic to link to this page.