health.csv
Codebookstate
: Statestate_abbr
: State Abbreviationgov_party
: Governor’s Partysen_party
: Senate Majority Partyhouse_party
: House Majority Partyleg_party
: Party in Control of Legislaturepercent_favorable_aca
: Percent Favorable to ACApercent_supporting_expansion
: Percent Suporting the Medicaid Expansionideology
: Ideologypercent_uninsured
: Percent without Health Insuranceinfant_mortality_rate
: Infant Mortality Ratecancer_incidence
: Age-Adjusted Cancer Incidence Rateheart_disease_death_rate
: Heart Disease Death Ratelife_expectancy
: Life Expectancyhealth_score
: Overall Health Scorehealth_score_cat
: Categorical Health ScoreThese data are taken from a 2014 article by Charles Barrilleaux and me 2013 article in State Politics and Policy titled “The Politics of Need: Examining Governors’ Decisions to Oppose the `Obamacare’ Medicaid Expansion.” See the article for the theortical and conceptual background.
The data set is at the state level, so that each row of the data set represents one state. The data are for September 2013.
# load packages
library(dplyr) # for data manipulation
library(ggplot2) # for plotting
# load data
health <- readRDS("data/health.rds")
# quick look at data
glimpse(health)
## Observations: 50
## Variables: 17
## $ state <chr> "Alabama", "Alaska", "Arizona", "...
## $ state_abbr <chr> "AL", "AK", "AZ", "AR", "CA", "CO...
## $ gov_party <fctr> Repubican Governor, Repubican Go...
## $ sen_party <fctr> Republican Senate, Republican Se...
## $ house_party <fctr> Republican House, Republican Hou...
## $ percent_favorable_aca <dbl> 38.27111, 37.44285, 39.67216, 36....
## $ percent_supporting_expansion <dbl> 57.76161, 47.42469, 53.21254, 54....
## $ obama_share_12 <dbl> 38.78377, 42.68471, 45.38662, 37....
## $ ideology <dbl> 0.24404363, 0.04723307, 0.1048642...
## $ percent_uninsured <int> 14, 19, 18, 18, 19, 15, 8, 10, 21...
## $ infant_mortality_rate <dbl> 9.2, 6.5, 6.4, 7.6, 5.1, 6.2, 6.1...
## $ cancer_incidence <dbl> 472.9, 451.4, 387.1, 426.7, 434.0...
## $ heart_disease_death_rate <dbl> 236.0, 151.5, 146.7, 222.5, 161.9...
## $ life_expectancy <dbl> 75.4, 78.3, 79.6, 76.0, 80.8, 80....
## $ leg_party <fctr> Unified Republican Legislature, ...
## $ health_score <dbl> -2.09998657, 0.04841030, 0.644463...
## $ health_score_cat <fctr> Bottom Tercile, Middle Tercile, ...
state
: State# print variable
print(health$state)
## [1] "Alabama" "Alaska" "Arizona" "Arkansas"
## [5] "California" "Colorado" "Connecticut" "Delaware"
## [9] "Florida" "Georgia" "Hawaii" "Idaho"
## [13] "Illinois" "Indiana" "Iowa" "Kansas"
## [17] "Kentucky" "Louisiana" "Maine" "Maryland"
## [21] "Massachusetts" "Michigan" "Minnesota" "Mississippi"
## [25] "Missouri" "Montana" "Nebraska" "Nevada"
## [29] "New Hampshire" "New Jersey" "New Mexico" "New York"
## [33] "North Carolina" "North Dakota" "Ohio" "Oklahoma"
## [37] "Oregon" "Pennsylvania" "Rhode Island" "South Carolina"
## [41] "South Dakota" "Tennessee" "Texas" "Utah"
## [45] "Vermont" "Virginia" "Washington" "West Virginia"
## [49] "Wisconsin" "Wyoming"
state_abbr
: State Abbreviation# print variable
print(health$state_abbr)
## [1] "AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DE" "FL" "GA" "HI" "ID" "IL" "IN"
## [15] "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV"
## [29] "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN"
## [43] "TX" "UT" "VT" "VA" "WA" "WV" "WI" "WY"
gov_party
: Governor’s Party# create table
table(health$gov_party)
##
## Democratic Governor Independent Governor Repubican Governor
## 19 1 30
sen_party
: Senate Majority Party# create table
table(health$sen_party)
##
## Democratic Senate Tied Senate Republican Senate
## 19 1 30
house_party
: House Majority Party# create table
table(health$house_party)
##
## Democratic House Tied House Republican House
## 21 0 29
leg_party
: Party in Control of Legislature# create table
table(health$leg_party)
##
## Unified Republican Legislature Divided Legislature
## 27 5
## Unified Democratic Legislature
## 18
percent_favorable_aca
: Percent Favorable to ACA# dotplot
ggplot(health, aes(x = percent_favorable_aca, y = state)) + geom_point()
percent_supporting_expansion
: Percent Suporting the Medicaid Expansion# order factor district by percent_supporting_expansion
health <- mutate(health, state = reorder(state, percent_supporting_expansion))
# dotplot
ggplot(health, aes(x = percent_supporting_expansion, y = state)) + geom_point()
ideology
: Ideology# order factor district by ideology
health <- mutate(health, state = reorder(state, ideology))
# dotplot
ggplot(health, aes(x = ideology, y = state)) + geom_point()
percent_uninsured
: Percent without Health Insurance# order factor district by percent_uninsured
health <- mutate(health, state = reorder(state, percent_uninsured))
# dotplot
ggplot(health, aes(x = percent_uninsured, y = state)) + geom_point()
infant_mortality_rate
: Infant Mortality Rate# order factor district by infant_mortality_rate
health <- mutate(health, state = reorder(state, infant_mortality_rate))
# dotplot
ggplot(health, aes(x = infant_mortality_rate, y = state)) + geom_point()
## Warning: Removed 1 rows containing missing values (geom_point).
cancer_incidence
: Age-Adjusted Cancer Incidence Rate# order factor district by cancer_incidence
health <- mutate(health, state = reorder(state, cancer_incidence))
# dotplot
ggplot(health, aes(x = cancer_incidence, y = state)) + geom_point()
## Warning: Removed 1 rows containing missing values (geom_point).
heart_disease_death_rate
: Heart Disease Death Rate# order factor district by heart_disease_death_rate
health <- mutate(health, state = reorder(state, heart_disease_death_rate))
# dotplot
ggplot(health, aes(x = heart_disease_death_rate, y = state)) + geom_point()
life_expectancy
: Life Expectancy# order factor district by life_expectancy
health <- mutate(health, state = reorder(state, life_expectancy))
# dotplot
ggplot(health, aes(x = life_expectancy, y = state)) + geom_point()
health_score
: Overall Health Scoreinfant_mortality_rate
, cancer_incidence
, heart_disease_death_rate
, and life_expectancy
using factor analysis. Higher values indicate a more healthy state.# order factor district by life_expectancy
health <- mutate(health, state = reorder(state, health_score))
# dotplot
ggplot(health, aes(x = health_score, y = state)) + geom_point()
# plot map
## load map data
states <- map_data("state")
## create lower-case version of variable state for merging with data frame states
health <- mutate(health, region = tolower(state))
## merge states and health data frame to choro
choro <- merge(states, health, by = "region")
choro <- choro[order(choro$order), ]
## plot map
ggplot(choro, aes(x = long, y = lat, group = group, fill = health_score)) +
geom_polygon()
health_score_cat
: Categorical Health Scorehealth_score
into the bottom, middle, and top terciles (third)# change health_score_cat to factor
health <- mutate(health, health_score_cat = factor(health_score_cat,
levels = c("Bottom Tercile",
"Middle Tercile",
"Top Tercile")))
# plot map
ggplot(choro, aes(x = long, y = lat, group = group, fill = health_score_cat)) +
geom_polygon()