Supporting project P2 · Health operations analytics · Public data (OpenML 43439, Brazil 2016)
Who misses clinic appointments — and can we see it coming?
An audit-first read of 110,521 real public-clinic appointments: booking lead time dominates no-show risk, the famous "SMS makes things worse" headline turns out to be confounding, and a plain logistic model holds its calibration on weeks it never saw.
What is real and what isn't — on this page
Real
- Every number: computed by
R/01_load_audit_model.Rfrom the authentic OpenML file (110,527 rows; checksum-scope verified 2026-10-24). - Cleaning: exactly 6 rows dropped (age <0 ×1, negative booking lead ×5) — disclosed, not silent.
- The bug ledger of 5 real build errors:
AI_GOT_IT_WRONG.md.
Not claimed here
- No causal claim about SMS (it is assigned operationally, not randomized).
- No claim that Brazilian magnitudes apply to Nigerian clinics — method transfers, numbers don't.
- No use of this model to gatekeep, deprioritise or deny care — forbidden by design and by the brief.
00 The two-minute version
Headline: booking lead time is the dominant no-show correlate — 4.6% same-day vs 32.6% at 14+ days (adjusted OR 11.34, 95% CI 10.55–12.19) — and a logistic model trained only on earlier weeks predicts later (never-trained-on) weeks' appointments at calibration slope 1.05 (ideal 1.00).
- Business question
- Which booking-time factors move no-show risk, and can a risk score help scheduling recover that lost capacity?
- Data
- 110,521 audited public-clinic appointments (Brazil, Apr 29 – Jun 8 2016), OpenML 43439, CC BY-NC-SA 4.0 — attribution: Joni Hoppen & Aquarela Advanced Analytics. REAL
- Method
- Base-R ARFF parse → audit battery → disclosed cleaning → grouped EDA → logistic model → temporal validation (train ≤ May 19; test May 20 – Jun 8). REAL
- Result
- Lead ladder 4.6→32.6% monotone; SMS paradox is confounding (adjusted OR 0.82); 60+ patients most reliable (OR 0.57); riskiest 40% of unseen bookings hold 65.6% of no-shows. REAL
- Recommendation
- Concentrate reconfirmation effort on 14+ day segment; same/short-lead substitution for waitlists; overbook only against measured top-quintile risk.
- Limitations
- Six-week window, one state; SMS association not causation; no clinical-severity fields; Brazilian magnitudes don't transfer.
- Next steps
- Add richer scheduling features, unit-level recalibration plan, local clinic pilot data once licenced.
01 The problem
Empty chairs in a full-booked clinic are invisible waste: capacity existed, demand existed, and both passed each other. The operational question is not "who misbehaves" — patients cancel for human reasons — it is where in the booking book does risk concentrate, measurably, before the day arrives?
The numbers that matter here are booking-time variables only — anything learned later (like being seen) would be leakage. A special caution signed at the top, from the mission brief: a no-show model may inform logistics — reminders, overbooking policy, same-day substitutions — and must never inform access. That rule held through every modelling choice.
Why this dataset as a Nigerian analyst: it's the most-used open no-show dataset in the world (110,527 real appointments, clearly documented), so the workflow stands inspection. The magnitudes belong to Espírito Santo, Brazil — the method is what a hospital data team anywhere would run.
02 The data
| Item | Detail | Verified | Status / limit |
|---|---|---|---|
| Dataset | Medical-Appointment-No-Shows — OpenML id 43439 | 2026-10-24 (file id 22102264) | REAL — public |
| Licence | CC BY-NC-SA 4.0 | API description | Non-commercial; attribution; share-alike applies to this page's derived tables |
| Attribution | Joni Hoppen & Aquarela Advanced Analytics | dataset header comment | Retained on every reuse |
| Coverage | 110,527 appointments · Apr 29 – Jun 8, 2016 · Espírito Santo (BR) | range audited in-script | Six-week window; one state |
| Variables | patient/appointment ids · gender · scheduled & appointment dates · age · neighbourhood · scholarship · hypertension · diabetes · alcoholism · handicap · SMS_received · No-show | 14 attributes | Ids discarded after the duplicate check (privacy-lite) |
| Audit findings | dup appointment ids 0 · age <0 1 · negative lead 5 · age >100 7 · gender balance F 71,840 / M 38,687 | printed in run log | 6 rows dropped, disclosed |
03 The process
- Parse, don't trust the parser. ARFF read with a structural guard (14 attributes) and a header whitelist — the guard caught both a wrong-file download and a wrong count (see the bug ledger).
- Audit battery first. Duplicates, impossible ranges, date-span sanity, category levels — printed before any model line existed.
- Disclosed cleaning. Exactly 6 rows dropped (1 impossible age, 5 negative booking leads) — 0.005% — and stated anywhere those counts feed.
- Booking-time features only. Lead-time bands, weekday, age bands, flags, SMS. No post-booking fields, no ids.
- Temporal validation by design. Train on everything before 2016-05-20, test on May 20–Jun 8 — the way a clinic would actually deploy.
- Plain logistic regression. Chosen for explanation (odds ratios with CIs a clinic board can read), audited for transfer (a
monthfeature was deliberately dropped — it can't exist out-of-time; logged as bug #5). - Metrics chosen on purpose. At 20% base rate, "everyone shows" scores 80.8%. So the report leads with calibration and capture, not accuracy.
04 What the data showed
05 The model
Grouped-visible logistic regression, all terms observable at booking. Reference cells: same-day lead · Monday · age 0–12 · no flags. Full table: outputs/coefficients_or.csv.
| Term | Odds ratio | 95% CI | Reading |
|---|---|---|---|
| Lead 1–2 days | 6.25 | 5.75–6.79 | just booking ahead doubles the cliffs |
| Lead 3–6 days | 7.31 | 6.74–7.93 | |
| Lead 7–13 days | 9.04 | 8.35–9.78 | |
| Lead 14+ days | 11.34 | 10.55–12.19 | headline correlate |
| SMS received | 0.82 | 0.78–0.86 | protective once lead is controlled |
| Age 13–24 | 1.24 | 1.16–1.33 | highest age cohort |
| Age 60+ | 0.57 | 0.53–0.62 | most reliable |
| Scholarship | 1.28 | 1.20–1.37 | socio-economic proxy — ethics-flagged |
| Diabetes | 1.15 | 1.05–1.25 | modest, p=.003 |
| Alcoholism | 1.33 | 1.17–1.50 | small flag, real signal |
| GenderM · Hypertension · handicap | n.s. | — | no signal, kept for face validity |
06 Validation — with honest labels
| Metric | Value | How computed / label |
|---|---|---|
| Train base rate | 20.95% (n=63,532) | REAL · ≤2016-05-19 |
| Test base rate | 19.17% (n=46,989) | REAL · 2016-05-20 → 06-08 |
| AUC | 0.726 | REAL · base-R rank statistic (no packages) |
| Calibration intercept | −0.105 | REAL · ideal 0 — slight over-prediction on later weeks |
| Calibration slope | 1.051 | REAL · ideal 1 — rates move correctly |
| Capture top 20% / 40% | 37.1% / 65.6% | REAL · unseen weeks |
| Null benchmark | 80.8% "accuracy" if predicting everyone shows | REAL — printed beside every metric table to stop the "80% accurate!" illusion |
07 Limitations
- Window: six weeks, one state — seasonality beyond weekday is unmeasured (and
monthwas refused as a feature for exactly this reason). - SMS is not randomized — the adjusted signal is associative; a clean claim would need allocation data.
- No clinical severity — risk ≠ need, and nothing here justifies differential access; the socio-economic coefficient is ethics-flagged in the model card.
- Neighbourhood granularity shown only at volume-aggregated top-N — small-cell areas were withheld from the page (privacy-lite instinct, not suppressed by licence).
- Transport: coefficients belong to this book, 2016, Espírito Santo. Local use requires local re-fit.
08 Impact & recommendation
- Target the >14-day segment — it carries 27.7% of the book (30,662 of 110,521) at 32.6% baseline risk; reconfirmation calls here pay back fastest.
- Same-/short-lead substitution queues — where clinically acceptable; the ladder suggests recovered slots re-fill at ~4.6% risk.
- Keep SMS; aim it better — adjust before judging channels (the paradox almost cost the reminder budget).
- Overbook only against measured top-quintile risk — 37.1% pooled capture is the honest anchor, not vibes.
Next steps: richer scheduling features, per-unit recalibration, and a licenced local pilot — same battery, local numbers.
09 Tools used
R (parse, audit battery, features, model, validation — zero packages) · Python/matplotlib (charts only) · hand-coded HTML/CSS. AI-assisted code with the published 5-entry bug ledger; every number re-read from outputs/ before publication.
Named paths (R/…, AI_GOT_IT_WRONG.md, SOLUTIONS_LOG.md) are relative to this project's repo folder — browse the files on GitHub ↗ (verified live 2026-10-25).