2014 US County Health Rankings

Mapping with ggplot2

ryancquan

Motivation

We begin with the following questions:

  • How do health outcomes vary across different counties in the United States?
  • Do we expect there to be a lot of variance within states? Between states?
  • Does health outcome data correlate with demographic data?

Approach

To answer these questions, we turned to data from County Health Rankings, a Robert Wood Johnson Foundation program.

Description from their website:

  • "The County Health Rankings measure the health of nearly all counties in the nation and rank them within states. The Rankings are compiled using county-level measures from a variety of national and state data sources."
  • "These measures are standarized and combined using scientifically-informed weights.""

Mapping in ggplot2

Using the numerical health outcomes and demographic data provided for each county, we decided to construct a choropleth map using ggplot2. Here, we run an embedded R code that creates a choropleth map of premature deaths in 2014.

Sample Code

usmap <- ggplot(plot_data, aes(map_id = region)) + 
        geom_map(map = map_county, aes(fill = measure)) + 
        expand_limits(x = map_county$long, y = map_county$lat) +
        coord_map("polyconic", xlim = c(-120, -71)) +  # change map projection
        scale_fill_gradient(high="#132B43", low="#56B1F7", name="value") +
        theme(axis.text=element_blank(), axis.ticks=element_blank(),
        axis.title=element_blank(),panel.grid.major=element_blank(),
        panel.background=element_blank()) + 
        geom_path(data = state_map, aes(x = long, y = lat), colour = "black") 

2014 US Premature Deaths by County

print(usmap)

plot of chunk unnamed-chunk-3

Final Thoughts

In our application, we allow the user to select among 63 health outcome or demographic measurements via a drop-down menu. We then automatically generate a choropleth map for the user's convenience.

The working Shiny app can be found at http://ryancquan.shinyapps.io/county-health-rankings/.

Future Improvements

  • Continuous measures can make it difficult to discern differences in health outcomes. Perhaps a better method would be to use a discrete scale or a better color palette with RColorBrewer.
  • Visualizations are more useful when the user is able to make comparisons. As such, the next iteration will include a second map so that the user can, for example, compare premature_death with violent_crime.
  • Further inquiry into the nature of missing data for particular counties.