Articles by R on

Covid Trajectories

September 3, 2021 | R on

I updated the covdata package for the first time in a while, as I’ll be using it to teach in the near future. As a side-effect, I ended up taking a look at what the ongoing polarization or divergence of the COVID experience is like in different p... [Read more...]

Map, Walk, Pivot

May 4, 2021 | R on

Recently I came across a question where someone was looking to take a bunch of CSV files, each of which contained numerical columns, and (a) get them into R, (b) calculate the mean and standard deviation of every column in every CSV file, and (c) calculate some overall summary like ... [Read more...]

Excess Deaths February Update

February 24, 2021 | R on

The CDC continues to update its counts of deaths by cause for 2020 as data comes in from the jurisdictions that report to it. The data are by now fairly complete, though there are still significant gaps in several states due to delayed reporting. North Carolina, in particular, has yet to ...
[Read more...]

Income and Happiness

January 26, 2021 | R on

People have been talking about this PNAS paper by Matthew Killingsworth: “Experienced well-being rises with income, even above $75,000 per year”. Here’s the abstract: Past research has found that experienced well-being does not incre... [Read more...]

Cross National Death Rates

December 18, 2020 | R on

Data from the Short Term Morality Fluctuations dataset compiled by the Human Mortality Database continues to be very interesting. When thinking about how to interpret the 2020 data in a cross-national and longitudinal context, it’s clear that the... [Read more...]

Excess Deaths by Jurisdiction

October 8, 2020 | R on

Although yesterday’s excess deaths plots by cause graph was for the whole of the United States only, the table we made did the same calculations on the whole CDC dataset, so the resulting df_excess table has numbers for all U.S. states and several other jurisdictions, such as ... [Read more...]

Excess Deaths by Cause

October 6, 2020 | R on

As I was saying the other day, calculating excess deaths can be a tricky business, especially if your focus is on understanding counterfactuals like how many people died of some cause who would not have died due to some other competing risk over the period of interest. Moreover, even setting ... [Read more...]

Walk the Walk

October 1, 2020 | R on

The other day I was looking to make a bunch of graphs showing some recent data from the CDC about excess mortality due to COVID-19. The idea was to take weekly counts of deaths over the past few years, both overall and from various important causes, and then show how ... [Read more...]

National Weekly Death Rates

September 26, 2020 | R on

Following up on yesterday’s post on within-state variation in deaths in the United States, here’s a quick look at all-cause mortality rates across twenty countries, courtesy of the excellent work of the demographers who maintain the Human M... [Read more...]

US Excess Mortality

September 24, 2020 | R on

The CDC recently released some new data on mortality counts by state and cause of death in the U.S., allowing us to get a look at excess mortality patterns due to the COVID-19 pandemic. I’ve folded the data into the covdata package. As an illustr... [Read more...]

Dataviz Interview

September 14, 2020 | R on

I had a very nice chat recently about data visualization with Brian Fannin, a research actuary with the CAS. We covered a variety of topics from R and ggplot in particular, to how to think about data visualization in general, and what the dataviz commu... [Read more...]

Some Data Packages

August 25, 2020 | R on

If you’re teaching statistics, data analysis, or data visualization with R this semester, especially in the social sciences, I’ve pulled together various bits of data into packages that I use in my own teaching. You might find them useful o... [Read more...]

Get Apple’s Mobility Data

May 23, 2020 | R on

I’ve been maintaining covdata, an R package with a variety of COVID-related datasets in it. That means I’ve been pulling down updated files from various sources every couple of days. Most of these files are at static locations. While their internal structure may change occasionally, and maybe they’... [Read more...]

New Orleans and Normalization

April 28, 2020 | R on

My post about Apple’s mobility data from a few days ago has been doing the rounds. (People have been very kind.) Unsurprisingly, one of the most thoughtful responses came from Dr. Drang, who wrote up a great discussion about the importance of choosing the right baseline if you’re ... [Read more...]

Apple’s COVID Mobility Data

April 23, 2020 | R on

Apple recently released a batch of mobility data in connection with the COVID-19 pandemic. The data is aggregated from requests for directions in Apple Maps and is provided at the level of whole countries and also for a selection of large cities around the world. I folded the dataset into ... [Read more...]

Upset Plots

April 16, 2020 | R on

The other day Nature reported some preliminary results from a study of COVID-19 symptoms that’s being carried out via a phone app. The report noted that loss of sense of smell (or “Anosmia”) seemed to be a common symptom. The report was accompanied by this graphic, showing the co-occurrence ... [Read more...]

Covdata Package

April 10, 2020 | R on

The covdata logo Partly because it grew out of a few code-throughs I was doing, but mostly as a classroom exercise, I pulled together a small data package for R called covdata, available at It contains COVID-19 data from three sources: National level data from ... [Read more...]

A COVID Small Multiple

March 27, 2020 | R on

John Burn-Murdoch has been doing very good work at the Financial Times producing various visualizations of the progress of COVID-19. One of his recent images is a small-multiple plot of cases by country, showing the trajectory of the outbreak for a large number of countries, with a the background of ... [Read more...]

Covid 19 Tracking

March 21, 2020 | R on

Get Your Epidemiology from Epidemiologists The COVID-19 pandemic continues to rage. I’m strongly committed to what should be the uncontroversial view that we should listen to the recommendations of those institutions and individuals with strong expertise in the relevant fields of Public Health, Epidemiology, Disease Control, and Infection Modeling. ... [Read more...]

U.S. Census Counts Data

March 15, 2020 | R on

As promised previously, I packaged up the U.S. Census data that I pulled together to make the population density and pyramid animations. The package is called uscenpops and it’s available to install via GitHub or with install.packages() if you set up drat first. The instructions are on ... [Read more...]
1 2 3

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)