← Back to selected work

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.

Completed v1.0 · temporal validation Data: public, CC BY-NC-SA 4.0 (attribution inside) Scheduling support — never care denial
110,521appointments after audit (6 drops disclosed)
20.19%overall no-show rate
4.6→32.6%no-show, same-day vs 14+ days lead
11.3×adjusted odds, 14+ day lead (95% CI 10.6–12.2)
0.73 / 1.05AUC / calibration slope, out-of-time
65.6%of unseen no-shows in riskiest 40%

What is real and what isn't — on this page

Real

  • Every number: computed by R/01_load_audit_model.R from 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

ItemDetailVerifiedStatus / limit
DatasetMedical-Appointment-No-Shows — OpenML id 434392026-10-24 (file id 22102264)REAL — public
LicenceCC BY-NC-SA 4.0API descriptionNon-commercial; attribution; share-alike applies to this page's derived tables
AttributionJoni Hoppen & Aquarela Advanced Analyticsdataset header commentRetained on every reuse
Coverage110,527 appointments · Apr 29 – Jun 8, 2016 · Espírito Santo (BR)range audited in-scriptSix-week window; one state
Variablespatient/appointment ids · gender · scheduled & appointment dates · age · neighbourhood · scholarship · hypertension · diabetes · alcoholism · handicap · SMS_received · No-show14 attributesIds discarded after the duplicate check (privacy-lite)
Audit findingsdup appointment ids 0 · age <0 1 · negative lead 5 · age >100 7 · gender balance F 71,840 / M 38,687printed in run log6 rows dropped, disclosed

03 The process

  1. 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).
  2. Audit battery first. Duplicates, impossible ranges, date-span sanity, category levels — printed before any model line existed.
  3. Disclosed cleaning. Exactly 6 rows dropped (1 impossible age, 5 negative booking leads) — 0.005% — and stated anywhere those counts feed.
  4. Booking-time features only. Lead-time bands, weekday, age bands, flags, SMS. No post-booking fields, no ids.
  5. Temporal validation by design. Train on everything before 2016-05-20, test on May 20–Jun 8 — the way a clinic would actually deploy.
  6. Plain logistic regression. Chosen for explanation (odds ratios with CIs a clinic board can read), audited for transfer (a month feature was deliberately dropped — it can't exist out-of-time; logged as bug #5).
  7. 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

No-show rate rises monotonically with booking lead time: 4.6 percent same-day to 32.6 percent at 14 plus days
So what: this is the head of the entire dataset — bookings beyond two weeks are ≈7× riskier than same-day in rate (32.6% vs 4.6%), 11.3× in adjusted odds. Concrete scheduling policy follows directly from this curve.
Raw no-show rates: SMS received 27.6 percent, not received 16.7 percent
So what (statistics teacher's moment): raw, SMS looks harmful. But receivers were booked further ahead — adjust for lead time and SMS-adjusted odds become 0.82. The paradox is selection. Any headline that skipped the adjustment would have cancelled the reminder budget.
No-show by age band: 13-24 highest near 24 percent, 60 plus lowest around 15 percent
So what: steady monotone decline with age; 60+ patients are the most reliable cohort (adjusted OR 0.57).
No-show rate by weekday, narrow band around 19 to 21 percent, Saturday empty
So what: weekday barely moves risk (Thursday dips slightly, OR 0.88). The calendar matters far less than the lead time. Saturday absent — the clinics don't book it (data honesty, not an omission).
Top 12 neighbourhoods by volume and their no-show rates
So what: area rates cluster near the overall 20% — place adds little beyond the lead-time and cohort biology. Useful for staffing the reminder desk's language plan, not for scanning individuals.

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.

TermOdds ratio95% CIReading
Lead 1–2 days6.255.75–6.79just booking ahead doubles the cliffs
Lead 3–6 days7.316.74–7.93
Lead 7–13 days9.048.35–9.78
Lead 14+ days11.3410.55–12.19headline correlate
SMS received0.820.78–0.86protective once lead is controlled
Age 13–241.241.16–1.33highest age cohort
Age 60+0.570.53–0.62most reliable
Scholarship1.281.20–1.37socio-economic proxy — ethics-flagged
Diabetes1.151.05–1.25modest, p=.003
Alcoholism1.331.17–1.50small flag, real signal
GenderM · Hypertension · handicapn.s.—no signal, kept for face validity
Out-of-time capture: riskiest 20 percent holds 37.1 percent of no-shows; riskiest 40 percent holds 65.6 percent
So what: on weeks it never saw, the model's top 40% of bookings contain 65.6% of the misses — enough to focus a reminder desk with AUC 0.73 and calibration slope 1.05.

06 Validation — with honest labels

MetricValueHow computed / label
Train base rate20.95% (n=63,532)REAL · ≤2016-05-19
Test base rate19.17% (n=46,989)REAL · 2016-05-20 → 06-08
AUC0.726REAL · base-R rank statistic (no packages)
Calibration intercept−0.105REAL · ideal 0 — slight over-prediction on later weeks
Calibration slope1.051REAL · ideal 1 — rates move correctly
Capture top 20% / 40%37.1% / 65.6%REAL · unseen weeks
Null benchmark80.8% "accuracy" if predicting everyone showsREAL — printed beside every metric table to stop the "80% accurate!" illusion

07 Limitations

  • Window: six weeks, one state — seasonality beyond weekday is unmeasured (and month was 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).