Hospital-level SSI data are sparse, particularly for low-volume facilities, making naive risk estimates unreliable. This project estimates facility-level SSI risk following colon procedures in California hospitals (2024), using hierarchical Bayesian modeling to produce stable estimates through partial pooling across facilities and counties.
Methods: Hierarchical Bayesian binomial models with partial pooling for facility- and county-level effects. Compared against logistic regression, non-hierarchical Bayesian binomial models, and GLMMs to illustrate what pooling recovers and where flat models break down.
Tools: R · JAGS · ggplot2 · plotly · tidyverse · MyST Markdown · LaTeX
Manuscript-Style Summary Available:
For a concise, manuscript-quality summary of this project, including abstract, full introduction, methods, results, and conclusions formatted in LaTeX, see the report PDF. The report focuses on the final hierarchical model and is formatted for publication.
.
├── 01_ca_colon_ssi.md # Intro and background section
├── 02_data.ipynb # EDA section
├── 03_non-hierarchical_models.ipynb # Non-hierarchical models
├── 04_hierarchical_models.ipynb # Hierarchical models
├── references.bib # BibTeX references
├── data/ # Raw dataset (publicly available)
├── figures/ # Generated figures from analyses
├── latex/ # LaTeX manuscript-style report
├── myst.yml # MyST project configuration
└── README.md # This file
Data for this analysis come from the California Department of Health and Human Services (CHHS) and are publicly available:
The dataset includes facility-level SSI counts and procedure volumes, as well as facility type and county identifiers. No individual patient-level data are included.
- Clone this repository:
git clone https://github.com/rdanielsstat/bayesian-ssi-analysis.git
cd bayesian-ssi-analysis- Install required R packages (example):
install.packages(c("dplyr", "rjags", "ggplot2", "plotly", "IRdisplay", "kableExtra"))- Render notebooks to HTML or PDF via MyST (example):
myst build myst.yml
# or use Jupyter / VSCode to run notebooks interactivelyThis will generate HTML/PDF outputs in the _build/ directory. Figures produced by the analysis are saved in the figures/ subfolder.
If you use this work in your research, please cite:
- Rob Daniels. Hierarchical Modeling of Surgical Site Infection Risk After Colon Surgery in California Hospitals (2024). GitHub repository: https://rdanielsstat.github.io/bayesian-ssi-analysis.
This repository is licensed under CC BY-NC 4.0.
Rob Daniels
Email: rdanielsstat@gmail.com
LinkedIn: https://www.linkedin.com/in/robcdaniels
GitHub: @rdanielsstat
Website: https://rdanielsstat.github.io