Skip to content

About

Wesleyan DataFest 2026 (Team 13): An analysis of 7.6 million hospital visits showing that patients without reliable transportation are 3 times more likely to visit the emergency room.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

159 Commits

Folders and files

Repository files navigation

When a Ride Is the Missing Treatment. Wesleyan DataFest 2026, Team 13. Emergency department visits per person-year: 1.94 for patients who reported a transportation barrier, 0.48 for those who did not.

CI R DuckDB License Site DataFest

A single question, "Has lack of transportation kept you from medical appointments?", identifies a patient group with over 3x higher odds of an emergency department visit after adjusting for age and sex. This repository contains the reproducible analysis pipeline behind that finding.

When patients can't get a ride to routine appointments, they may miss care they need. This project used de-identified records covering 7.6 million encounters for 947,685 patients to compare acute-care use between patients who did and didn't report a transportation barrier.

Patients who reported a barrier made about four times as many emergency department visits per person-year and about three times as many inpatient admissions. The data is observational, so it identifies an association rather than what an intervention would save. Since the health system already asks the question, the answer could help identify patients who might benefit from ride support, tele-visits, or case management.

Live site: datafest-2026.vercel.app

The opening of the DataFest 2026 write-up, When a Ride Is the Missing Treatment. A road diagram compares emergency department visits per person-year for patients who reported a transport barrier and patients who did not.

What this is

Team 13's project for ASA DataFest 2026 at Wesleyan University (April 17 to 19, 2026). The data sponsor was Stormont Vail Health, which provided an anonymized electronic health record sample linked to social needs survey responses.

Full deliverables:

Key findings

Outcome No barrier reported (n = 55,653) Transport barrier reported (n = 2,986) Comparison
ED visits per person-year 0.48 1.94 4.0x the rate
Inpatient admissions per person-year 0.22 0.70 3.2x the rate
Any ED visit in the window 43% 68% adjusted OR 3.17 (95% CI 2.93 to 3.43)
Any inpatient admission in the window 35% 63% adjusted OR 3.49 (95% CI 3.23 to 3.77)

The odds ratios come from a logistic model, outcome ~ transport + age + sex, fit on the 58,639 screened patients. They compare odds, not visit counts, so they aren't interchangeable with the rate ratios above them.

What this means:

  • ED visits: Patients who reported a transportation barrier made about four times as many emergency department visits per person-year.
  • Inpatient admissions: The same patients had about three times as many inpatient admissions per person-year, and higher odds of any admission after adjusting for age and sex.
  • Across chronic conditions: Among patients with an index encounter for hypertension, type 2 diabetes, chronic kidney disease, or atrial fibrillation, barrier patients returned to the ED within 180 days more often in every cohort (33% vs 15%, 40% vs 17%, 37% vs 21%, and 34% vs 24%). Barrier patients were also younger overall (median age 51 vs 61); that comparison alone does not rule out age-related confounding.

For the full caveats, see the writeup and the Caveats section below.

Pipeline

After the ETL, everything reads from one DuckDB file. The exception is 05_figures.R, which reads the CSV tables that 04_analyses.R writes.

01_etl.R loads seven CSVs into datafest.duckdb. 03_journey.R reads the file and writes the patient_analytic table back. 02_eda.R, 06_flourish_export.R, and 04_analyses.R read from it. 04_analyses.R writes CSV tables, and 05_figures.R reads those instead of the database.

Edit the diagram.

07_slide4_line_export.R runs separately and draws the slide 4 chart from the Flourish CSVs. Outputs land in output/tables/, output/figures/, and output/flourish/.

run_all.R runs the pipeline. After a run, smoke_test_outputs.R checks that the expected outputs exist.

Reproducing the analysis

The raw EHR data is not in this repo (license restriction). The pipeline is reproducible against any DataFest 2026 CSV bundle dropped into DataFest 2026 - Data Challenge/Data/2026-ASA-DataFest-Data-Files/.

# 1. R packages (one-time, into ~/R/datafest_libs)

Rscript -e 'install.packages(c("data.table","duckdb","DBI","dplyr","tidyr","stringr","lubridate","ggplot2","scales","rpart"), lib="~/R/datafest_libs")'

# 2. Drop the CSV bundle into place

# DataFest 2026 - Data Challenge/Data/2026-ASA-DataFest-Data-Files/*.csv

# 3. Run the pipeline (builds ~/.datafest_cache/datafest.duckdb on first run)

Rscript analysis/R/run_all.R

# 4. Smoke-test the outputs

Rscript analysis/tests/smoke_test_outputs.R

If the DB already exists, skip ETL: Rscript analysis/R/run_all.R --skip-etl.

The shared SQL for Flourish CSV exports lives in analysis/sql/ and can be run by the DuckDB CLI directly (see analysis/sh/flourish_export_duckdb_cli.sh).

Full run-order details: analysis/README.md.

Caveats

The data is observational and the screening sample is non-random.

  • Only ~6% of patients in the release (61,052 / 947,685) answered the transportation questions, so absolute prevalences shouldn't be projected to the whole system.
  • 20% of encounter rows carry a diagnosis key that isn't in the diagnosis lookup (a known data issue per the sponsor Q&A), so the chronic-disease cohorts are a lower bound.
  • 65% of patients have no parseable location code, so geographic models were not fit.
  • Patient journeys are tracked within the 2022 to 2025 window; rates are annualized by observed follow-up.

Tech stack

  • R 4.3+ for data processing and statistical analysis
  • DuckDB for fast queries across 7.6 million hospital encounter records
  • Flourish & RAWGraphs for interactive charts
  • ffmpeg for video exports
  • LaTeX (XeLaTeX) for the research writeup PDF

Acknowledgments

License

Code in this repository is released under the MIT License. The underlying EHR and survey data are not included and remain subject to the data-use agreement with Stormont Vail Health and the ASA DataFest 2026 release terms.

About

Wesleyan DataFest 2026 (Team 13): An analysis of 7.6 million hospital visits showing that patients without reliable transportation are 3 times more likely to visit the emergency room.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages