Package: cosmic 0.5
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>.
Authors:
cosmic_0.5.tar.gz
cosmic_0.5.zip(r-4.7-any)cosmic_0.5.zip(r-4.6-any)cosmic_0.5.zip(r-4.5-any)
cosmic_0.5.tgz(r-4.6-any)cosmic_0.5.tgz(r-4.5-any)
cosmic_0.5.tar.gz(r-4.7-any)cosmic_0.5.tar.gz(r-4.6-any)
cosmic_0.5.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
cosmic/json (API)
| # Install 'cosmic' in R: |
| install.packages('cosmic', repos = c('https://gregridgeway.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/gregridgeway/cosmic/issues
Last updated from:5b6ef2e7e1. Checks:9 OK. Indexed: yes.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel | OK | 119 | ||
| source / vignettes | OK | 206 | ||
| linux-release | OK | 138 | ||
| macos-release | OK | 149 | ||
| macos-oldrel | OK | 172 | ||
| windows-devel | OK | 105 | ||
| windows-release | OK | 78 | ||
| windows-oldrel | OK | 64 | ||
| wasm-release | OK | 117 |
Exports:cosmicdiagnoseofficer_summaryoutlier_reportposterior
Dependencies:abindbackportscheckmateclidistributionaldplyrgenericsgluelifecyclemagrittrmatrixStatsnumDerivpillarpkgconfigposteriorR6rlangtensorAtibbletidyselectutf8vctrswithr
Readme and manuals
Help Manual
| Help page | Topics |
|---|---|
| Fit the Conditional Ordinal Stereotype Model (COSMIC) | cosmic |
| Diagnose a COSMIC fit | diagnose diagnose.cosmic_fit |
| Summarize officers relative to their peer groups | officer_summary |
| Create an outlier-focused report table | outlier_report |
| Extract posterior draws from a COSMIC model | posterior posterior.cosmic_fit |
| Print and summarize a COSMIC fit | print.cosmic_fit summary.cosmic_fit |