The purpose of this report is to show how society’s infatuation with rankings can lead us to jump to superficial conclusions about how those who are being ranked are actually faring vis-a-vis their “competitors”. I use data from the 2015-2016 UNITED HEALTH FOUNDATION’s Annual Report and focus on deaths due to cancer by state. I look first at the rankings of each state through a chloropleth similar to that displayed by United Health Foundation’s application. Afterwards, however, I look at the percentage change in each state from 2015 to 2016 of the death rate due to cancer. Finally, I use a chloropleth map of the United States to color code the 4 cases of ranking and death rate shifts to lend insight on how the rankings in themselves don’t tell the whole story but also lend one to erroneously deduce that those states who rank high (positively) are faring well in the fight against cancer.
The four categories of Rankings combined with percent change in cancer death rates are as follows:
Green: Rankings improved and the death rate improved. Yellow: Rankings improved and the death rate did not improve. Orange: Rankings did not improve and the death rate improved. Red: Rankings did not improve and the death rate did not improve.
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.3.3
library(dplyr)
## Warning: package 'dplyr' was built under R version 3.3.3
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(rgdal)
## Warning: package 'rgdal' was built under R version 3.3.3
## Loading required package: sp
## Warning: package 'sp' was built under R version 3.3.3
## rgdal: version: 1.2-13, (SVN revision 686)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 2.2.0, released 2017/04/28
## Path to GDAL shared files: C:/Users/Peter Beretich/Documents/R/win-library/3.3/rgdal/gdal
## Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
## Path to PROJ.4 shared files: C:/Users/Peter Beretich/Documents/R/win-library/3.3/rgdal/proj
## Linking to sp version: 1.2-5
thestates <- readOGR("C:/Users/Peter Beretich/Documents/thomas/USMAnalyticscourse/unit08", "states")
## OGR data source with driver: ESRI Shapefile
## Source: "C:/Users/Peter Beretich/Documents/thomas/USMAnalyticscourse/unit08", layer: "states"
## with 51 features
## It has 5 fields
names(thestates)
## [1] "STATE_NAME" "DRAWSEQ" "STATE_FIPS" "SUB_REGION" "STATE_ABBR"
library(knitr)
cancer<-read.csv("statehealthrankings.csv",header=TRUE,stringsAsFactors = FALSE)
head(cancer)
## State X2014Rank X2014CancerDeaths X2015Rank X2015CancerDeaths
## 1 Alabama 43 211.5 43 211.6
## 2 Alaska 27 191.8 32 194.1
## 3 Arizona 5 170.2 5 169.6
## 4 Arkansas 46 214.9 46 216.9
## 5 California 6 171.0 6 170.1
## 6 Colorado 3 163.0 3 162.2
## X2016Rank X2016CancerDeaths ChangeInRank ChangeinDeathRatePerc
## 1 43 211.1 - -0.24
## 2 29 193.3 -3 -0.41
## 3 6 170.0 1 0.24
## 4 46 218.1 - 0.55
## 5 5 169.9 -1 -0.12
## 6 3 161.8 - -0.25
## rank.improved death.rate.improved Color YearToYearRank ColorCode
## 1 no y orange 43 ->43 3
## 2 yes y Green 32 ->29 1
## 3 no n red 5 ->6 4
## 4 no n red 46 ->46 4
## 5 yes y Green 6 ->5 1
## 6 no y orange 3 ->3 3
state_cancer<-merge(thestates,cancer,by.x="STATE_NAME", by.y="State")
state_popup<-paste("<strong>State: </strong>",
state_cancer$STATE_NAME,
"<br><strong>2015 to 2016 Rankings: </strong>",
state_cancer$YearToYearRank,
"<br><strong>Change in Death Rate: % </strong>",
state_cancer$ChangeinDeathRatePerc)
pal <- colorQuantile(palette="YlGn", domain=NULL, n=4)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data=state_cancer,
fillColor = ~pal(X2016Rank),
color = "white",
opacity = 1,
fillOpacity=.8,
weight=2,
popup=~state_popup)
##Map of US States showing the range of changes in Cancer death rates by state from 2015 to 2016.(Note the 2.19% increase in deaths due to Cancer in the state of Utah which currently ranks number 1 as that state with the lowest overall death rate due to Cancer)
state_cancer<-merge(thestates,cancer,by.x="STATE_NAME", by.y="State")
state_popup<-paste("<strong>State: </strong>",
state_cancer$STATE_NAME,
"<br><strong>2015 to 2016 Rankings: </strong>",
state_cancer$YearToYearRank,
"<br><strong>Change in Death Rate: % </strong>",
state_cancer$ChangeinDeathRatePerc)
pal<-colorQuantile("Greys", NULL,n=4)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data=state_cancer,
fillColor = ~pal(ChangeinDeathRatePerc),
color = "white",
opacity = 1,
fillOpacity=.8,
weight=2,
popup=~state_popup)
state_cancer<-merge(thestates,cancer,by.x="STATE_NAME", by.y="State")
state_popup<-paste("<strong>State: </strong>",
state_cancer$STATE_NAME,
"<br><strong>2015 to 2016 Rankings: </strong>",
state_cancer$YearToYearRank,
"<br><strong>Change in Death Rate:% </strong>",
state_cancer$ChangeinDeathRatePerc)
pal<-colorFactor(c("green","yellow","orange","red"),
domain=state_cancer$ColorCode)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data=state_cancer,
fillColor = ~pal(ColorCode),
color = "white",
opacity = 1,
fillOpacity=.8,
weight=2,
popup=~state_popup)
##Here I have made a map that shows the four possible scenarios described briefly in the introduction. Note the orange states that have actually dropped in the rankings from 2015 to 2016 and yet the outcome measure of deaths due to cancer have actually dropped. Note also those yellow states who improved their rankings and yet their cancer death rates actually increased.