CoVID-19: Visualizing individual patient data
By: Bruno Gonçalves
Tags: Covid 19, Patient Experience, Epidemiology, Sars Cov2, Data Science

As the number of worldwide CoVID-19 cases quickly races to 8 Million with already over 430, 000 fatalities, the interest in understanding how it spreads from person to person and from country to country continues to increase.

This interest, has resulted in the unprecedented availability of a wide range of datasets, analyses, commentary and discussion. Last time we analyzed the Jonhs Hopkins University dataset on the number of confirmed cases around the world.

In this blog post we dive into University of Washington’s Institute for Health Metrics and Evaluation dataset on individual patients to obtain a detailed look at the time interval between the first symptoms occur and the patient gets tested. You can get more details on the dataset the companion Natural Scientific Data paper.

Geographic distribution

The IHME patient dataset contains information on over 2,300,000 individuals patients, almost 30% of the total number of cases.

Geographical distribution of the patients in the IHME dataset

The patients are from 144 countries in all corners of the world, as shown in the map above. The dataset includes date of symptom onset, date of official case confirmation, age, gender, location, symptoms and travel history, among many other features. However, the data availability varies widely from country to country, with countries like Germany providing age information for practically all of their patients while most other countries providing it for only a fraction or even none of them. In total, out of the 2.3 Million patients, we only know the age (or age group) of 311, 085.

Total number of patients by country and number of patients with age information

Delay between symptom onset and case confirmation

In this post, we are interested in analyzing the delay between the date of symptom onset and case confirmation through RT-PCR test. In total, after we clean the dataset, we have valid onset and confirmation information available for 136, 141 patients around the world, roughly 6% of the original total.

Distribution of the number of days between symptom onset and case confirmation

The heatmap above is simple to read. For each symptom onset date (say, March 22), we can locate all the dates in which those patients officially tested positive by simply seeing the spread of values along the y-axis. In this case, we can see that most positive tests occurred within a week (between March 22 and March 29), while some others weren’t confirmed until several months later.

Number of patients with complete information for each country

Out of the 136, 141 patients for which we have complete information, over 80% of them are from Germany and 17% from Mexico. Given this discrepancy in data availability we decide to focus the remainder of this analysis on Germany. This has the added advantage of avoiding to potentially mix different data biased due to varying procedures and policies across countries while still utilizing most of the dataset.

A detailed look at Germany

Germany provides age information aggregated into 6 age groups and for both males and females:

Distribution across age group and gender

Our first step is to analyze the delay distribution across for each age group and check for significant differences between genders:

Delay distribution by age group and gender. For visualization purposes, we truncated the distribution at 28 days despite the fact that a small fraction of patients report significantly larger delays between symptoms and testing

Overall, the delay distribution is the same across all age groups with small differences between the sexes. To improve our statistics, we also calculate the overall delay distribution. This has the added advantage of not requiring age or gender information to be used so it has a wider range of possible applications.

Symptom onset timeline

Now that we have the distribution of the delay between symptom onset and case confirmation, we can use it to calculate the time line of when symptom onsets and compare it with the official timeline of confirmed cases.

To do this, we use the delay distribution to assign a symptom onset date for all the positive tests of a given day. From the distribution above, we know that roughly 11% of the confirmed cases started displaying symptoms 3 days before, while 5% had symptoms 10 days before. We can use this to move 11% (and 5%) of the confirmed cases in a specific day 3 (and 10) days back, respectively. Mathematically, this is known as a convolution. The resulting Symptom Onset time series is show below:

Timelines for the date of symptom onsets and case confirmations in Germany.

One important benefit of this approach is that not only does it bring us one step closer to extracting the real infection time line, it also automatically removes the natural fluctuations due to the differences between weekdays and weekends.

If we also had a reliable distribution of delays between infection time and symptom occurrence we could repeat this approach to obtain an estimate of when infections actually occurred.

This kind of analysis is the first step in estimating the way in which the reproductive number, Rt, is evolving in time. We will dive deeper in to this calculation in future posts, but you can find all the details here.

Resources

If you’ve made it this far, congratulations! And if you’re interested in diving more deeply into the technical details underlying epidemic modeling you might be interested in the other blog posts of this series that I’ve been writing over the past few weeks:

You should check them out! The Python code for this and all the other posts can be found on GitHub:

And you can sign up for my weekly newsletter where I share the latest news and developments in Machine Learning and Data Science as well as any future blog posts I write.