<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Tozer on Medium]]></title>
        <description><![CDATA[Stories by James Tozer on Medium]]></description>
        <link>https://medium.com/@jamestozer?source=rss-ac176d663425------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ifr6XHwPkK_firXV.</url>
            <title>Stories by James Tozer on Medium</title>
            <link>https://medium.com/@jamestozer?source=rss-ac176d663425------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 07:19:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jamestozer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Measuring the true toll of the pandemic]]></title>
            <link>https://medium.com/the-economist/measuring-the-true-toll-of-the-pandemic-fa7e003b3ff4?source=rss-ac176d663425------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa7e003b3ff4</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[coronavirus]]></category>
            <category><![CDATA[journalism]]></category>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[data-journalism]]></category>
            <dc:creator><![CDATA[James Tozer]]></dc:creator>
            <pubDate>Fri, 24 Apr 2020 17:05:41 GMT</pubDate>
            <atom:updated>2020-04-24T17:08:11.240Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>How The Economist measures excess deaths caused by covid-19</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/0*wrwUoVP5A5rsmmdv" /></figure><p>One of the grim ironies of the covid-19 pandemic is that the world has shown an unprecedented interest in data — and yet there has never been so much uncertainty around official statistics. Facebook and Twitter have become catalogues of terrifying charts, as people around the globe have tried to work out how quickly the SARS-CoV-2 virus is spreading. Meanwhile, academics and journalists have come up with lots of inventive ways to quantify the impact of the pandemic. <em>The Economist</em> has, for example, published analyses of <a href="https://www.economist.com/graphic-detail/2020/03/07/tourism-flows-and-death-rates-suggest-covid-19-is-being-under-reported">tourist flows</a>, <a href="https://www.economist.com/graphic-detail/2020/03/14/foot-traffic-has-fallen-sharply-in-cities-with-big-coronavirus-outbreaks">footfall in major global cities</a> and <a href="https://www.economist.com/graphic-detail/2020/04/18/how-the-internet-has-changed-during-lockdowns">internet usage</a>.</p><p>Yet we still don’t know the numbers that matter most. Because countries have different testing capabilities, and many carriers show no symptoms, we don’t know how many people the virus has infected. More worryingly, we don’t even know exactly how many people it has killed. As I <a href="https://www.economist.com/graphic-detail/2020/04/03/covid-19s-death-toll-appears-higher-than-official-figures-suggest">reported in early April</a>, the official covid-19 tolls in many countries exclude victims who were not tested before passing away. It often takes several days to establish and report the cause of death, creating a lag in the data. And if hospitals are overwhelmed, people with other conditions might not get the intensive care they need to survive. As a result, the numbers of deceased that get read out each night on the news are smaller than the true number of fatalities that the virus has already caused.</p><p>During medical crises such as this one, a better way to measure mortality is to look at a region’s “excess deaths”: the number of people who have died of all causes, compared with the average for the same period in previous years. I have been using two approaches to do this. The first is to take publicly available data about mortality, produced regularly by a handful of statistical bureaus, and estimate how many more people have died than usual in a selection of places. The second is to use figures from <a href="https://www.euromomo.eu/">EuroMOMO</a>, a network of epidemiologists in 24 European countries, which covers 350m people in its weekly reports. As the pandemic continues, I will update all of these datasets on <a href="https://www.economist.com/graphic-detail/2020/04/16/tracking-covid-19-excess-deaths-across-countries">our excess-mortality tracker, which is available free to all readers</a>.</p><h4><strong>How I calculated The Economist’s estimates</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/0*jY0k0vjTDHwv4chu" /><figcaption><em>For each country or region, we have compared excess deaths with official covid-19 figures</em></figcaption></figure><p>One of the biggest challenges when it comes to measuring the spread of the virus is that every country collects its data differently. This is particularly true for the official covid-19 figures. For example, France has conducted a considerable amount of testing in care-homes, and includes fatalities from such institutions in its daily tolls, whereas almost all of the Netherlands’ reported deaths have occurred in hospitals.</p><p>Yet the data about deaths from all causes, which might seem more straightforward to collect, also vary in quality and frequency across countries. Spain’s Carlos III Institute, its national epidemiology centre, is publishing <a href="https://momo.isciii.es/public/momo/dashboard/momo_dashboard.html#ccaa">daily figures for each region</a> — but these have a large lag, and are increased retrospectively when newer data come in (see chart below). By contrast, Britain’s Office for National Statistics produces <a href="https://www.ons.gov.uk/peoplepopulationandcommunity/birthsdeathsandmarriages/deaths/datasets/weeklyprovisionalfiguresondeathsregisteredinenglandandwales">a weekly total of the number of death certificates registered in its system</a>, which are not revised in future. So the comparisons between countries are not entirely apples-to-apples. We have also had to use a simple method for our baseline of “expected deaths”: an average for the same week in previous years (ideally the past five years, but sometimes two or three, depending on availability).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ra5cOexTmK7rG77q" /><figcaption><em>Spain’s daily data on total deaths are often revised retrospectively</em></figcaption></figure><p>Moreover, some countries have reported only partial mortality data, which cover a non-random selection of regions or victims. In <a href="https://turkiye.gov.tr/istanbul-buyuksehir-belediyesi-vefat-sorgulama">Istanbul</a> and <a href="https://pertamananpemakaman.jakarta.go.id/v140/t15">Jakarta</a>, the two non-Western places currently in our tracker, I am relying on tallies of the number of people who have been buried, as reported by local departments. These figures will not pick up everybody who has died, but they are still much higher than the official covid-19 tolls. Turkey does not even give regular breakdowns of covid-19 deaths by region, so we had to estimate that Istanbul had half of the national share, based on a report from April 1st. Given how slowly many developing countries publish their all-cause mortality data, I will probably have to use a similar approach to find numbers in South America, Africa, Asia and the Middle East.</p><p>Even some rich nations do not have complete data. Italy’s National Institute of Statistics (ISTAT) has released <a href="https://www.istat.it/it/archivio/240401">figures on all deaths</a> for just 1,700 of the country’s 7,900 municipalities (or <em>comuni</em>) — only the ones that have both shown at least a 20% increase this year and claim to have accurate records. This makes it impossible to come up with a national tally of excess deaths in the European country that was hit hardest. However, because these <em>comuni </em>cover 7.2m of the 10m people in Lombardy, the worst-affected Italian region, I was able to produce an estimate for that area. I found <a href="https://www.arcgis.com/home/webmap/viewer.html?url=https://services1.arcgis.com/XannvQVnsM1hoZyv/ArcGIS/rest/services/COMUNI_COVID19/FeatureServer&amp;source=sd">a snapshot map</a> of official covid-19 deaths for those <em>comuni</em> at the end of March, and used that to predict what share of Lombardy’s deaths these 7.2m people suffered each week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*O4ABWgsvJevc04LX" /><figcaption><em>Our estimate of total and covid-19 deaths in Lombardy, based on the available comuni</em></figcaption></figure><p>All of this data-cleaning is fiddly and time-consuming, especially because the underlying spreadsheets are in different formats and languages. Whenever new data are published, I check them carefully, in case the definitions have changed. <a href="https://github.com/nychealth/coronavirus-data/blob/master/probable-confirmed-dod.csv">New York’s official death toll</a>, for example, has started to include people who “probably” died of covid-19, according to the symptoms on their death certificates. To make this process more organised, I wrote a script in R, the programming language used most often by data journalists at <em>The Economist</em>, to do the cleaning for me. It is about 1,000 lines long, and spits out CSV files in the same format for each country. Those go into a Github repository, which <a href="https://twitter.com/martgnz">Martín González</a>, one of our brilliant interactive journalists, uses to make the dynamic charts for our tracker. We hope that, at some point, once we have made the code presentable, to make this resource publicly available — keep checking <a href="https://github.com/TheEconomist">our GitHub</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/0*ABZyUpi55xJcItaL" /><figcaption><em>I’ve used an R script to clean the raw data files from each country, often in a foreign language!</em></figcaption></figure><h4><strong>How EuroMOMO comes up with its estimates</strong></h4><p>Although I have been able to find mortality numbers for many European countries, not all of them make these data publicly available in a timely fashion. Germany, for example, has only released <a href="https://www.destatis.de/DE/Themen/Gesellschaft-Umwelt/Bevoelkerung/Sterbefaelle-Lebenserwartung/sterbefallzahlen.html">nationwide figures up to March 13th</a> (at the time of writing), since like Italy it struggles to coordinate lots of regional offices.</p><p>To get around this, I’ve collaborated with EuroMOMO’s epidemiologists. They collect mortality data on a weekly basis across Europe, which we will include on our tracker. And while they don’t break down the absolute numbers of fatalities by country, they do provide a trend chart for each member state <a href="https://www.euromomo.eu/graphs-and-maps/#z-scores-by-country">on their website</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/0*B2zkeyFdjzfM22TH" /><figcaption><em>EuroMOMO’s data show that covid-19 has far surpassed even the worst flu seasons</em></figcaption></figure><p>In this respect, EuroMOMO is a unique resource. No other continent has such a coordinated system. The United States has a <a href="https://gis.cdc.gov/grasp/fluview/mortality.html">“Pneumonia and Influenza Mortality Surveillance” tool</a>, which publishes weekly total deaths for each state. But states take months to update their figures, which is why we have only included the city of New York in our tracker so far.</p><p>While working with EuroMOMO, I spoke to Lasse Skafte Vestergaard, to find out more about how the data are collected and what the limitations might be. Lasse coordinates the network, and helps put together the bulletin that the group publishes each Thursday. He is also an epidemiologist at Denmark’s national institute for infectious disease, and has specialised in influenza, malaria and parasitology.</p><p><strong>JT: Lasse, your organisation is the only one that tracks excess mortality across an entire continent. How did this come about?</strong></p><p>LSV: EuroMOMO’s network was set up in response to the global influenza pandemic in 2009, to ensure early detection of future public health events. Currently we have 28 partner institutions across 24 countries and regions. We also have representatives from the European Centre for Disease Prevention and Control (ECDC) and the World Health Organization (WHO) Regional Office for Europe, who both support the network activities and our hub financially, participate in technical discussions, and help our active strategy to expand geographical coverage, especially in Eastern Europe. For example, Ukraine has recently started to provide monthly data to the hub. One of the great strengths of our approach has been its consistency and close collaboration between participating countries, running week after week, year after year. Putting together the national data from all of them adds power to detect smaller changes than what individual countries may immediately see.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*xbzBbWD9lcQaqpqC" /><figcaption><em>Deaths among people aged 15–64 have risen significantly, as well as those among over 65s</em></figcaption></figure><p><strong>JT: How comprehensive are your numbers?</strong></p><p>LSV: Our data come from national or regional statistical offices, and are typically based on information on deaths recorded in civil registers. Overall, our sample covers a substantial proportion of the European population, with more than 350 million people. However, the fraction covered varies quite a lot between countries, from 95–100% in many to only 15–20% in others. This all depends on local administrative systems and political decisions.</p><p><strong>JT: Are there any limitations that people interpreting the numbers should be aware of?</strong></p><p>First of all, we are providing mortality estimates, based on certain statistical models and assumptions, not the exact numbers of deaths. There will always be some level of uncertainty around them. Secondly, the coverage in some countries is only for a few selected regions or cities, for example in Germany and Italy. Since we are looking at national-level estimates, the observed figures may not adequately detect much higher mortality levels within smaller parts of a country. Finally, even the best quality reporting is not fully complete, and there are always a few days or weeks of delay. We apply an adjustment function in the statistical algorithms, but still, the estimates provided for the most recent weeks must be read with caution.</p><p><strong>JT: Some readers might look at EuroMOMO’s charts and think that the death toll from covid-19 is no worse than from some of the recent flu seasons. How would you respond?</strong></p><p>LSV: Given the dramatic mortality signals we are already seeing, especially in some parts of Europe, we can conclude that this pandemic is not just another flu — not at all. It is striking to see large variation, from extremely high excesses in one country to normal levels in neighbouring ones. We will later have to evaluate the effect of the various societal preventive measures, initiated with different speeds and levels of coverage. Then we can conclude what should be recommended in terms of preparedness for future pandemics.</p><p>We don’t yet know how long we will keep updating <em>The Economist</em>’s tracker. If the pandemic surges and then abates over several months, as countries go into and out of periods of lockdown, then excess mortality figures will be an important measure of how well social-distancing policies are working, and when they need to be enforced. I will keep digging away at official reports and spreadsheets in various languages, and expanding our ever-more tangled R script. If any readers spot data that we could use, or corrections that we need to make to the existing numbers, those would be very helpful — and I would be happy to hear about them at <a href="/service/mailto:jamestozer@economist.com">jamestozer@economist.com</a>.</p><p><a href="https://twitter.com/J_CD_T"><em>James Tozer</em></a><em> is a data journalist at </em><a href="https://www.economist.com/graphic-detail/">The Economist</a><em>. You can follow The Economist Data Team’s work on </em><a href="https://twitter.com/ECONdailycharts"><em>Twitter</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa7e003b3ff4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-economist/measuring-the-true-toll-of-the-pandemic-fa7e003b3ff4">Measuring the true toll of the pandemic</a> was originally published in <a href="https://medium.com/the-economist">The Economist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting into a scrape]]></title>
            <link>https://medium.com/the-economist/getting-into-a-scrape-cb18ee0aca77?source=rss-ac176d663425------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb18ee0aca77</guid>
            <category><![CDATA[data-journalism]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[journalism]]></category>
            <dc:creator><![CDATA[James Tozer]]></dc:creator>
            <pubDate>Thu, 29 Nov 2018 12:22:39 GMT</pubDate>
            <atom:updated>2018-11-29T12:22:39.669Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Why learning to code is worth it for journalists</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*iu01Mp-86Sx9IuhIN6mj0w.jpeg" /><figcaption>Pic by Jon Manning via Flickr</figcaption></figure><p>If, like me, you grew up with a love of writing but a pig-headed ignorance of algebra and algorithms, then the idea of learning to code has probably never crossed your mind. If it has, then it almost certainly repulsed you. Computer programming seems akin to sewage engineering: complicated, vital for society, and so mind-numbingly unpleasant that thankfully other people are paid to do it. When I started to think about becoming a journalist, I stubbornly overlooked college courses with a data science component. Who needs to learn the language of computers to tell a good story?</p><p>Working at <em>The Economist </em>has shown me that it can help — a lot. I started here as a paid intern, giving performance insights to our newsroom and social media team, having used some basic web analytics tools for a journalism start-up. I arrived with a patchy knowledge of Microsoft Excel and a couple of introductory books about statistics. Like anybody who has ever interned at a newspaper, I also wanted to write some articles. Number-crunching was a good way in, because (when done properly) it allows you to say something empirical and distinctive. With patient supervision from some of the paper’s statisticians, I was able to come up with a few stories using datasets from governments and a handful of companies.</p><p>But what if nobody has collected the data before? Discussions with other journalists about potential stories would often meander towards: “It’s an interesting topic, but gathering numbers on it would require a lot of manual collection or some help from the data team.” Enter the coders. <em>The Economist</em> has several journalists with computer-programming skills. Many of them are adept at “scraping” text and numbers from the internet — that is, writing scripts that open hundreds (or even thousands) of web pages and copy information from them into a spreadsheet. Some of the best off-the-wall articles that we have published, such as these ones about<a href="https://www.economist.com/briefing/2014/08/07/more-bang-for-your-buck"> prostitution</a> and <a href="https://www.economist.com/international/2016/07/16/shedding-light-on-the-dark-web">drugs on the dark web</a>, were based on web scraping.</p><p>Inspired by these stories, I decided to learn how to code. I picked up a few lessons along the way:</p><h4><strong>1. You don’t have to be a numerical wizard for web scraping to be worthwhile</strong></h4><p>For many of the articles that I ended up writing with scraped data, I used barely any maths, beyond simple sums and averages. My first story looked at <a href="https://www.economist.com/britain/2017/11/09/mapping-gay-life-in-britain">the spread of LGBT venues</a> — nightlife, saunas, community groups and so on — around rural Britain, with a straightforward measure of venues per capita in each county.</p><h4><strong>2. You don’t have to learn fancy statistical techniques</strong></h4><p>Many online coding courses promise a future career as a data scientist. (R and Python are the languages of choice among journalists: the former is great for statistics and charts, the latter is more flexible for everything else.) I ended up enjoying the modules about econometrics and machine learning, but took the ones on web scraping first. It is perfectly possible to learn how to code without any maths whatsoever.</p><h4>3. <strong>You will suck at coding for ages, but stick with it</strong></h4><p>Teaching yourself computer programming is like learning a musical instrument. You will spend most of your time being infuriatingly bad at it, and the realisation that ten-year-old prodigies have already mastered it while you can barely string a few lines together will often make you want to hurl your keyboard against the wall. But once you reach a basic level of competency, you can suddenly do most of the cool things that you want to, albeit clumsily. There is a definite satisfaction in conquering a tricky website with your scraping code. If you focus solely on the basics of your chosen language and then the web scraping aspects, you should get there within 50 hours of practice. (<a href="https://medium.freecodecamp.org/better-web-scraping-in-python-with-selenium-beautiful-soup-and-pandas-d6390592e251">Selenium</a>, my preferred scraping library, takes a little longer.)</p><h4>4. <strong>You can</strong> <strong>scrape responsibly</strong></h4><p>Scraping a website involves many automated visits, but most websites will start blocking visits from your IP address when they detect too many. So you should set up your scraper to avoid this. Make sure it covers only as many pages as you need to. Break your scraping tasks into separate sessions. And leave long load times between each page request (10 seconds will usually do it). Many websites have terms and conditions that forbid you from selling on the data, but journalistic research is usually in the clear.</p><p>Coding gives you the ability to come up with entirely novel information. I have used scraping to write articles about <a href="https://www.1843magazine.com/data-graphic/what-the-numbers-say/where-to-ski">ski resorts</a>, <a href="https://www.economist.com/united-states/2018/08/30/googling-the-news">Donald Trump’s criticism of Google News</a>, <a href="https://www.economist.com/prospero/2018/08/09/fifty-years-on-led-zeppelin-are-still-idols-for-aspiring-rock-stars">Led Zeppelin</a> and several pieces for our <a href="https://www.economist.com/blogs/gametheory">sports blog</a>. But scraping can also be a gateway drug to the <a href="https://www.economist.com/science-and-technology/2018/07/19/python-has-brought-computer-programming-to-a-vast-new-audience">countless other awesome software packages</a> that languages like Python contain, from astronomy to video-game design. For example, I eventually earned a writing job on our data journalism team thanks to learning statistical modules. These helped me discover interesting patterns in all sorts of data, such as which countries are <a href="https://www.economist.com/graphic-detail/2018/05/25/irelands-people-are-more-liberal-than-its-abortion-laws-imply">most likely to have liberal abortion laws</a>, and which are <a href="https://www.economist.com/graphic-detail/2018/06/12/what-google-searches-and-gdp-can-tell-you-about-footballing-success">most likely to be good at football</a>.</p><p>A little coding knowledge can be a valuable skill for a journalist — and will only become more so.</p><p><a href="https://twitter.com/J_CD_T"><em>James Tozer</em></a><em> is a data journalist at </em>The Economist<em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb18ee0aca77" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-economist/getting-into-a-scrape-cb18ee0aca77">Getting into a scrape</a> was originally published in <a href="https://medium.com/the-economist">The Economist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>