John Lekberg


Diabetes Death Rates for Black New Yorkers

Created 2019-08-02.

Black New Yorkers have the highest death rates from diabetes.

This graphic uses New York City's "Leading Causes of Death" dataset.

This graphic shows Diabetes death rates for black new yorkers compared to other races. As you can see there is a markedly higher death rate for black new yorkers compared to any other race. Why is this?

A technique I'm trying to develop is build a facetted graph with each facet containing the other facet's data in some "shadow" (like, greyed out). My idea with this is that it allows for individual examination of each facet, and it gives the wider context of the data.

I think applying this technique to the graphic is effective because seeing the death rates for other races so far below shows just how high the diabetes death rates for black New Yorkers are.


Code used to create "Diabetes Death Rates for Black New Yorkers"


code.r - Main code used to generate the graphic.
# DATA
df %>%
  # TRANS
  filter(Leading.Cause == "Diabetes Mellitus (E10-E14)") %>%
  filter(!(Race.Ethnicity %in% c("Not Stated/Unknown", "Other Race/ Ethnicity"))) %>%
  mutate(Is.Black = Race.Ethnicity == "Black Non-Hispanic") %>%
ggplot() +
  # SCALE
  scale_color_manual(
    name="Race",
    values = c("grey", "black"),
    labels = c("Not Black", "Black"),
  ) +
  # COORD
  facet_grid(~ Sex) +
  # GUIDE
  ggtitle(
    "Diabetes Death Rates for Black New Yorkers",
    subtitle = "Compared to death rates for whites, hispanics, and asians."
  ) +
  ylab("Deaths per 100,000") +
  # ELEMENT
  geom_line(aes(Year, Death.Rate, group=Race.Ethnicity, color=Is.Black)) +
  # THEME
  theme_classic()