Year: 2020

  • 2020 wrap-up of South African COVID-19 deaths

     4 short months ago I collected some data on the causes of death in South Africa, placing the deaths attributed to COVID-19 in context, mostly for my own edification. Even then, when they numbered less than half of what they are now, it was clear that this was a serious concern. At the time, I neglected some analysis due to a lack of time. Notably I didn’t normalise by population, even though the figures I quoted were from different years.

    I’ve taken advantage of a more relaxed schedule to extend my analysis to the table below:

    I will repeat my sources below to save you from paging through to the previous post. As before I must mention that the “influenza and pneumonia” figures for 2017 were without significant countermeasures like lockdowns or mask wearing.

    Note that the population normalisation doesn’t affect the ranking. 

    In order to keep things simple, I’ve kept the original 2017 death figures up, even though some of the numbers could be updated, notably the number for TB, which appears to have grown to around 64 000 in 2019 [5] (although I believe these figures are not attributing utlimate causes quite the same way).

    With the second surge of deaths, the disease has moved up to be comfortably above the HIV deaths in 2017, roughly equal to all other viral diseases.

    Comparing daily rates is also revealing. In 2017, a total of 465286 deaths were recorded, an average daily death rate of around 1274. At the time of my writing this, the average death rate per day from COVID-19 is around 280 and climbing, which would have been a full 20 % of these deaths.

    Sources

    † Underlying cause of death (previously known as primary cause) is the disease or injury that initiated the sequence of events leading directly to death; or the circumstances of the accident or violence which produced the fatal injury. [1]
  • South African COVID-19 deaths in context

     I was curious this morning, so I spent some time digging for context to the numbers we’re constantly seeing ticking up on our reports these days.

    The following chart shows this context.

    As always, it’s hard to get recent statistics for South Africa. I started with the top 10 natural causes of death in South Africa from StatsSA [1]. I’ve used their attribution of the underlying causes, Table 4.16 on p58 and also show the lumped “All non-natural causes” from the same report. Although this document was published in 2020, it only goes up to 2017. Viewing COVID-19 deaths [2] in this light shows it is considerable, even though it is at the bottom of the list. Note that the COVID-19 figures don’t distinguish between underlying or immediate cause and include significant interventions to mitigate their effects when compared to for example the Influenza and pneumonia figure in the chart.

    Road fatalities are always quite worrying to me – I don’t think the average South African is worried enough about them. I used the official Dept of Transport report for 2018 [3]. I find it interesting that these numbers are comparable.

    I know that people in South Africa are particularly worried about the murder rate, so I added the Africa Check reported numbers for 2019 [4]. Murder occupies a sobering position in the chart.

    Some additional notes are in order to establish more context.

    • I haven’t normalised by population, mainly because these numbers involve yet another dive into the data sets for South Africa.
    • The COVID-19 numbers are for a partial year, not for a whole year
    • The influenza and pneumonia numbers do not include any active measures like lockdown or mask wearing.
    • Many of these numbers are not directly comparable in terms of mechanism, and the number for murder for instance would be included in the “All non-natural causes” number if I were designing this correctly.
    My personal conclusion from this is that COVID-19 deaths are significant when compared to these other causes of death.

    Sources

    † Underlying cause of death (previously known as primary cause) is the disease or injury that initiated the sequence of events leading directly to death; or the circumstances of the accident or violence which produced the fatal injury. [1]
  • Indispensable command-line tools

    Indispensable command-line tools

    I spend a great deal of time in my terminal when I am using my computer. According to RescueTime I’ve spent more than 40 hours in my terminal this year.

    I won’t go into a great deal of detail in this post about the things that I do, but I think it is useful to put all of the things I find really useful in one place.

    Non-commands

    Before you can start using the terminal you need a good terminal program. I’ve been using iTerm for a long time. I will admit that I don’t use even half of its many features, but I love the fact that I can click on URLs to open them in my browser, or filenames to open them in Finder, not to mention the extensive options for setting up the input methods and fonts. Multi-tab support is also amazing, and I’m always a little in awe that they took the time to display the correct history when the app restarts after a reboot.

    Next I would like to mention my programming/terminal font. It’s been a long journey, but I’ve finally settled on the Fira Code Nerd Font. I know the use of ligatures in code is a contentious issue, but I love them.

    Also a shout out to my colour scheme: solarized:


    Choose your shell

    Almost everyone uses bash as their shell program. I switched to zsh (using oh-my-zsh for all the configuration) after seeing that it had more powerful tab completion out of the box and I haven’t really looked back. I highly recommend taking some time to configure (or choose a configuration for)  your prompt so that it saves you time. You don’t need to do git status every time you enter a directory if the info you need is all in your prompt. In the screenshot below the green arrow to the left of the prompt shows the previous command exited successfully, the git:(master) shows me I’m in a git repo on the master branch and the cross mark shows the repo is dirty (needs files to be committed).

    Commands

    Of course, when you’re in the terminal, you’re going to be executing commands! I recommend learning the basic unix utilities, of course, but I’ve got some extra stuff installed that makes me much more productive. An interesting trend is that many of these extra utilities are written in Rust. I’m not sure if this is because I’m learning rust and therefore Google knows I have an affinity for Rust things or if there’s just an interesting trend of people rewriting things in rust. Whatever it is I can vouch that I am actively using every tool I recommend here:

    • exa, a replacement for ls. I have aliased ls to exa and my life is better because of it. What I find particularly useful is better use of colour than ls, the ease of using ISO 8601 and built-in tree view.
    • fzf, fuzzy searching everywhere. If you follow the default install instructions it will hook onto your shells ctrl-r command and supercharge it so that you can do fuzzy matching of history items. If that’s all you get from it, it’s already really great. But you can use it in lots of different ways, for instance you can just pipe a file’s contents to it to filter lines matching a fuzzy pattern. You can see what this looks like in the screenshot of my terminal above.
    • bat, a cat replacement. You think “cat is so basic, how will rewriting it in Rust make it better”? Then you see the automatic line numbering, the automatic paging, the automatic syntax highlighting and you understand. I’ve just aliased both cat and less to bat and again my life is better.
    • fd, for finding files. I love the find command, but its options can be a little arcane. If you’re just wanting to search for a pattern recursively, rather use fd. It understands code, so it doesn’t report hits on hidden files and blobs in your .git folder and also knows about .gitignore and will use it.
    • ripgrep, for finding inside them. Another rust tool, this is just blindingly fast. ripgrep kind of replaces the combination of find and grep that you often need to do to find something in a big nested directory full of code.
    • autojump, jump to your frequently-visited directories. The idea is pretty genius – hook onto the cd command and count how many times you’ve visited specific directories. Then supply a command (j) which jumps you directly there. I love that you don’t need to remember much to use it as if you only use cd it’s working fine. Then you remember “oh – I can maybe j to that directory directly” and it just works. Amazing.
    • GNU parallel, which works a little bit like xargs, but has a much more friendly way of handling files with spaces and automatically parallelises calls. This tool has saved me a great deal of coding because it makes it so easy to write a program which does just one part of a task and then run it in parallel with load balancing and a nice progress bar. I cannot recommend this tool enough.
    • jq, something like sed for json files. If you use json a lot, you need to get jq installed.
    • jid, a good companion to jq which allows you to build your filter strings interactively and see what gets returned. It’s a bit slower, but not slower than repeatedly running jq to get just the right output
    • vd, a commandline data viewer. Very good for quickly viewing tabular data, but also very deep once you get into it.