Mortality Rate by Age

R
Published

19 Jul 2016 04:00

Working further with the mortality data from https://www.cdc.gov/, I’ve added a breakdown of deaths by age and gender to the lifespan package on GitHub.

Here’s a summary plot:

Density plot of deaths per year versus age broken down by gender.
library(lifespan)
NYEARS = length(unique(deaths$year))
ggplot(deathsage, aes(x = age, y = count / NYEARS / 1000)) +
    geom_area(aes(fill = sex), position = "identity", alpha = 0.5) +
    geom_line(aes(group = sex)) +
    # facet_wrap(~ sex, ncol = 1) +
    labs(x = "Age", y = "Deaths per Year [thousands]") +
    scale_x_continuous(breaks = seq(0, 150, 10), limits = c(0, 120)) +
    theme_minimal() + theme(legend.title = element_blank())

There are a few interesting observations to be made. We’ll start with the most obvious:

Another way of looking at the same data is with a stacked area plot. It’s more difficult to see compare genders, but gives a better indication of the overall mortality rate.

Stacked density plot of deaths per year versus age broken down by gender.