cassionData Analysis

Exercise · Intermediate

Forty-seven cases with no onset

The epidemic curve is due at four o'clock. Forty-seven of 975 cases have no onset date and they are not spread evenly. Draw the curve three ways, say which one you would send, and what the missing dates could still be hiding.

Python75 min

The cluster coordination meeting is at four o’clock and it wants the epidemic curve. You have the line list, sixteen weeks of it, and forty-seven cases with no onset date.

Dropping them takes one line and nobody will notice. That is the problem.

The file

cholera-line-list-2024.v1.csv — 975 cases across three districts, with onset date, admission date where the case was admitted, and outcome. Synthetic. district-population-2024.v1.csv carries the population by district and age band.

The task

Part one. Draw the curve three ways on one set of axes, or three panels if you prefer: by onset among cases that have one, by admission date among cases that were admitted, and by onset with the missing dates imputed from admission using each district’s own median delay. Weekly bins, and label each series with its n.

Part two. The three curves peak in different weeks and hold different totals. For each, write one line saying what population of cases it describes — not what it looks like, what it is.

Part three. Find out whether the missing onset dates are missing at random. Break the 47 down by district, by outcome and by whether the case was admitted, and say in three sentences what pattern you find and which of your three curves it damages most.

Part four. Choose the curve you would put in front of the meeting, and write the caption it goes out with. Three sentences at most, including the total, the denominator, and the one thing a reader must not conclude from it.

What you will need to handle

Three things, and none is a data error.

  • 327 cases were never admitted. The admission-date curve is therefore drawn on two thirds of the outbreak, and the third it drops is not a random third.
  • One district’s onset dates are back-filled from the admission book. Its median onset-to-admission delay is nought days with about 80% of its cases recorded as same-day. Imputing that district’s missing onset dates from its own median delay will therefore do nothing at all, which is worth noticing before you present the imputation as a fix.
  • One case has no outcome. It changes nothing in this exercise, and saying so is part of the answer.

Three reference points

The onset curve runs on 928 cases and peaks in the seventh week — the week ending 23 June — with 111 cases. Missing onset dates split 21 in Centre, 18 in Nord and 8 in Sud. If your peak lands elsewhere, check whether your weekly bins start at the first onset or at a calendar boundary, and say which you used.

The questions to answer in prose

Three sentences each.

1. Your admission-date curve peaks later than your onset curve. Explain the two distinct reasons for the shift — one is biological and one is a recording practice — and say which of them you can quantify from this file.

2. Imputation using each district’s median delay is defensible in two districts and useless in the third. Name the district, say why, and describe what you would need in order to impute its onsets honestly.

3. A colleague suggests reporting the curve on the 928 cases with an onset date and the attack rates on all 975. Say whether that is acceptable, and what a reader would have to be told for it to be.

What to hand in

A Python script or notebook producing:

  • the three weekly curves, plotted and printed as a table of week against count, each with its n stated
  • the missingness breakdown by district, outcome and admission status
  • the caption from part four as a docstring or markdown cell, not a code comment
  • the three prose answers

How to know you are done

Every figure you print carries the number of cases it was computed from, and a reader can tell from the labels alone which of your three curves is which. Delete the outputs, run it again from a clean kernel, and the numbers are identical — including the imputed one, which means your median delays were computed before the imputation rather than from a frame that already contains it.