The objective of this research project is to determine whether counties with certain health issues have higher or lower rates of violent crimes. The cost of health insurance is a major debate in American politics and it would also be helpful to figure out if counties with high rates of persons without health insurance also have higher rates of violent crimes. In communities that struggle with health insurance accessiblity, there may be more violent crimes stemming from robberies or assaults as people are trying to access medicines or health/nutritional resources. This information would be beneficial to potentially reduce crime in a area that is in dire need of healthcare and resources.
I selected two datasets from Social Explorer, including the U.S. Health 2014 and the U.S. Crime 2014. The following variables will be examined by mapping:
Violent Crime Rate Tobacco & Alcohol Usage *Health Insurance
library(tigris)
## To enable
## caching of data, set `options(tigris_use_cache = TRUE)` in your R script or .Rprofile.
##
## Attaching package: 'tigris'
## The following object is masked from 'package:graphics':
##
## plot
library(tmap)
library(dplyr)
##
## 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(readr)
library(sf)
## Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
options(tigris_class = "sf")
US_map <- counties(cb = TRUE)
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|== | 4%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|==== | 7%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 10%
|
|======= | 11%
|
|======= | 12%
|
|======== | 12%
|
|======== | 13%
|
|========= | 13%
|
|========= | 14%
|
|========= | 15%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 16%
|
|=========== | 17%
|
|=========== | 18%
|
|============ | 18%
|
|============ | 19%
|
|============= | 19%
|
|============= | 20%
|
|============= | 21%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 22%
|
|=============== | 23%
|
|=============== | 24%
|
|================ | 24%
|
|================ | 25%
|
|================= | 25%
|
|================= | 26%
|
|================= | 27%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|=================== | 30%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 33%
|
|====================== | 34%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 36%
|
|======================== | 37%
|
|======================== | 38%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 39%
|
|========================== | 40%
|
|========================== | 41%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 42%
|
|============================ | 43%
|
|============================ | 44%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 45%
|
|============================== | 46%
|
|============================== | 47%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 50%
|
|================================= | 51%
|
|================================= | 52%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 53%
|
|=================================== | 54%
|
|=================================== | 55%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 56%
|
|===================================== | 57%
|
|===================================== | 58%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 59%
|
|======================================= | 60%
|
|======================================= | 61%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 62%
|
|========================================= | 63%
|
|========================================= | 64%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 66%
|
|=========================================== | 67%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================= | 70%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 76%
|
|================================================== | 77%
|
|================================================== | 78%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 79%
|
|==================================================== | 80%
|
|==================================================== | 81%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 82%
|
|====================================================== | 83%
|
|====================================================== | 84%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 85%
|
|======================================================== | 86%
|
|======================================================== | 87%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 90%
|
|=========================================================== | 91%
|
|=========================================================== | 92%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 93%
|
|============================================================= | 94%
|
|============================================================= | 95%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 96%
|
|=============================================================== | 97%
|
|=============================================================== | 98%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 99%
|
|=================================================================| 100%
US_map$GEOID <- as.integer(US_map$GEOID)
VC<-read_csv ("C:/Users/Skippz/Downloads/R12145620_SL050.csv")%>%
rename(Violent_Crimes = SE_T004_001, GEOID = Geo_FIPS)
## Parsed with column specification:
## cols(
## Geo_FIPS = col_character(),
## Geo_NAME = col_character(),
## Geo_QNAME = col_character(),
## Geo_STATE = col_character(),
## Geo_COUNTY = col_character(),
## SE_T004_001 = col_double(),
## SE_T004_002 = col_double(),
## SE_T004_003 = col_double(),
## SE_T004_004 = col_double(),
## SE_T004_005 = col_double(),
## SE_T004_006 = col_double()
## )
VC$GEOID<- as.integer(VC$GEOID)
## Warning: NAs introduced by coercion
Health<-read_csv ("C:/Users/Skippz/Downloads/HI_Smoke_Al.csv")%>%
rename(No_Insurance = SE_T006_002, Current_Smokers = SE_T011_001, Current_Drinkers = SE_T011_002, GEOID = Geo_FIPS)
## Parsed with column specification:
## cols(
## Geo_FIPS = col_character(),
## Geo_NAME = col_character(),
## Geo_QNAME = col_character(),
## Geo_STATE = col_character(),
## Geo_COUNTY = col_character(),
## SE_T006_001 = col_double(),
## SE_T006_002 = col_double(),
## SE_T006_003 = col_double(),
## SE_NV007_001 = col_double(),
## SE_NV007_002 = col_double(),
## SE_NV007_003 = col_double(),
## SE_T011_001 = col_double(),
## SE_T011_002 = col_double(),
## SE_NV011_001 = col_double(),
## SE_NV011_002 = col_double()
## )
Health$GEOID<- as.integer(Health$GEOID)
library(tmaptools)
#Merging US country map with Health Data
merge <- left_join(US_map, Health, by="GEOID")
merge$STATEFP <- as.integer(merge$STATEFP)
hi_map <- merge %>%
filter(STATEFP != 02) %>%
filter(STATEFP != 15) %>%
filter(STATEFP != 60) %>%
filter(STATEFP != 66) %>%
filter(STATEFP != 69) %>%
filter(STATEFP != 72) %>%
filter(STATEFP != 78) %>%
filter(STATEFP != 79)
usmap <- merge %>%
aggregate_map(by = "STATEFP")
#Merging US Map with Violent Crime Data
merge1 <- left_join(US_map, VC, by="GEOID")
merge1$STATEFP <- as.integer(merge1$STATEFP)
vc_map <- merge1 %>%
filter(STATEFP != 02) %>%
filter(STATEFP != 15) %>%
filter(STATEFP != 60) %>%
filter(STATEFP != 66) %>%
filter(STATEFP != 69) %>%
filter(STATEFP != 72) %>%
filter(STATEFP != 78) %>%
filter(STATEFP != 79)
usmap1 <- merge1 %>%
aggregate_map(by = "STATEFP")
According to the first map, the highest rate of persons without health insurance across U.S. counties is in the state of Texas and New Mexico. Montana and Idaho also have several areas where people report not having health insurance and at the end of Florida there are people reporting no health insurance. Florida is a popular destination for retirement, which may contribute to the lack of health insurance. Overall, the South seems to struggle with health insurance and in particular the Southwest has multiple pockets where peope report no health insurance. This information should attract politicans to the South to determine why there are so many people struggling to acquire health insurance.
tm_shape(hi_map, projection = 2163) +
tm_polygons("No_Insurance", palette = "PRGn", showNA = TRUE, border.col = "gray50", border.alpha = .4) +
tm_shape(usmap) +
tm_borders(lwd = .36, col = "black", alpha = 1) +
tm_layout(panel.labels=("Persons W/O Health Insurance in the U.S., 18 - 64yrs (2014)"),legend.position = c("left","bottom"))
##Mapping Alcohol Usage Across the U.S.
Alcohol use is reported highest around the county of Hudspeth, Texas. It is interesting that data is missing in much of the Texas state on alcohol usage. The midwest seems to have the greatest alcohol usage, especially in Milwaukee and Minneapolis. Alcohol usage is also prominent in Northern Albany. It would be interesting to bring up university data to see if there are pockets of alcohol usage related to university locations as college aged students tend to drink a significant amount.
tm_shape(hi_map, projection = 2163) +
tm_polygons("Current_Drinkers", palette = "YlOrBr", showNA = TRUE, border.col = "gray50", border.alpha = .4) +
tm_shape(usmap) +
tm_borders(lwd = .36, col = "black", alpha = 1) +
tm_layout(panel.labels=("Current Drinkers in the U.S., (2014)"),legend.position = c("left","bottom"))
##Mapping Tobacco Usage Across the U.S.
In this map, smoking is highest in the Southeast and Northeast. Arkansas, Missouri, and Kentucky seem to struggle with smoking the most. Texas continues to be missing data, which is interesting considering it was the county that earlier had the highest rate of persons without health insurance. For further research, it would be interesting to see the average working hours of people in these areas. Frequency of smoking may be related to stressful work hours or certain forms of labor, such as working outdoors may lead to smoking more often. Smoking can also be used for medicinal purposes to reduce anxiety or stress. But when compared to the previous map on “Persons W/O Health Insurance in the US”, there does not seem to be an obvious correlation between no health insurance and smoking usage.
tm_shape(hi_map, projection = 2163) +
tm_polygons("Current_Smokers", palette = "RdBu", showNA = TRUE, border.col = "gray50", border.alpha = .4) +
tm_shape(usmap) +
tm_borders(lwd = .36, col = "black", alpha = 1) +
tm_layout(panel.labels=("Current Smokers in the U.S., (2014)"),legend.position = c("left","bottom"))
##Mapping Violent Crime Rate Across the U.S. Total Violent Crime Rate in this map is highest in Missippi and Boston. There multiple counties sprinkled thoroughout the Midwest that seem to have an issue with violent crimes. Further mapping that includes comparing counties with income and education level may shed light on why these locations have a high rate of violent crimes in 2014.
tm_shape(vc_map, projection = 2163) +
tm_polygons("Violent_Crimes", palette = "PRGn", showNA = TRUE, border.col = "gray50", border.alpha = .4) +
tm_shape(usmap1) +
tm_borders(lwd = .36, col = "black", alpha = 1) +
tm_layout(panel.labels=("Total Violent Crime Rate in the U.S., (2014)"),legend.position = c("left","bottom"))
The non-spatial is not nearly as helpful and informative as the spatial approach. With the spatial approach, I am given multiple types of information from location, size, and distribution of an occurence. With the non-spatial approach, in the information is minimal and not always as clear to see or determine relationships between variables.
library(ggplot2)
ggplot(Health, aes(x=`No_Insurance`)) + geom_histogram(fill= "Blue") + theme_light() +ggtitle("Distribution of Persons W/O Health Insurance")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 1 rows containing non-finite values (stat_bin).
ggplot(Health, aes(x=`Current_Smokers`)) + geom_histogram(fill= "Blue") + theme_light() +ggtitle("Distribution of Tobacco Usage")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 430 rows containing non-finite values (stat_bin).
ggplot(Health, aes(x=`Current_Drinkers`)) + geom_histogram(fill= "Blue") + theme_light() +ggtitle("Distribution of Alcohol Usage")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 916 rows containing non-finite values (stat_bin).
CB refers to cartographic boundaries. These boundaries help distingush geographical areas as it creates the boundary along shorelines, making a separate individual line to represent rivers. Cartographic boundaries are often used for thematic mapping and analytical purposes.
When comparing the cb_map to the previous map, it appears to have lower resolution and a slightly blurry look to it. The previous map with “cb=TRUE” is certainly more readable and clearer to decipher cartographic boundaries.
options(tigris_class = "sf")
CB_map <- counties(cb = FALSE)
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|== | 4%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|==== | 7%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 10%
|
|======= | 11%
|
|======= | 12%
|
|======== | 12%
|
|======== | 13%
|
|========= | 13%
|
|========= | 14%
|
|========= | 15%
|
|========== | 15%
|
|========== | 16%
|
|=========== | 16%
|
|=========== | 17%
|
|=========== | 18%
|
|============ | 18%
|
|============ | 19%
|
|============= | 19%
|
|============= | 20%
|
|============= | 21%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 22%
|
|=============== | 23%
|
|=============== | 24%
|
|================ | 24%
|
|================ | 25%
|
|================= | 25%
|
|================= | 26%
|
|================= | 27%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 28%
|
|=================== | 29%
|
|=================== | 30%
|
|==================== | 30%
|
|==================== | 31%
|
|==================== | 32%
|
|===================== | 32%
|
|===================== | 33%
|
|====================== | 33%
|
|====================== | 34%
|
|====================== | 35%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 36%
|
|======================== | 37%
|
|======================== | 38%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 39%
|
|========================== | 40%
|
|========================== | 41%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 42%
|
|============================ | 43%
|
|============================ | 44%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 45%
|
|============================== | 46%
|
|============================== | 47%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 50%
|
|================================= | 51%
|
|================================= | 52%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 53%
|
|=================================== | 54%
|
|=================================== | 55%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 56%
|
|===================================== | 57%
|
|===================================== | 58%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 59%
|
|======================================= | 60%
|
|======================================= | 61%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 62%
|
|========================================= | 63%
|
|========================================= | 64%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 65%
|
|=========================================== | 66%
|
|=========================================== | 67%
|
|============================================ | 67%
|
|============================================ | 68%
|
|============================================= | 68%
|
|============================================= | 69%
|
|============================================= | 70%
|
|============================================== | 70%
|
|============================================== | 71%
|
|============================================== | 72%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 73%
|
|================================================ | 74%
|
|================================================ | 75%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 76%
|
|================================================== | 77%
|
|================================================== | 78%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 79%
|
|==================================================== | 80%
|
|==================================================== | 81%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 82%
|
|====================================================== | 83%
|
|====================================================== | 84%
|
|======================================================= | 84%
|
|======================================================= | 85%
|
|======================================================== | 85%
|
|======================================================== | 86%
|
|======================================================== | 87%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 88%
|
|========================================================== | 89%
|
|========================================================== | 90%
|
|=========================================================== | 90%
|
|=========================================================== | 91%
|
|=========================================================== | 92%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 93%
|
|============================================================= | 94%
|
|============================================================= | 95%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 96%
|
|=============================================================== | 97%
|
|=============================================================== | 98%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 99%
|
|=================================================================| 100%
new_HI<-read_csv ("C:/Users/Skippz/Downloads/HI_Smoke_Al.csv")%>%
rename(No_Insurance = SE_T006_002, Current_Smokers = SE_T011_001, Current_Drinkers = SE_T011_002, GEOID = Geo_FIPS)
## Parsed with column specification:
## cols(
## Geo_FIPS = col_character(),
## Geo_NAME = col_character(),
## Geo_QNAME = col_character(),
## Geo_STATE = col_character(),
## Geo_COUNTY = col_character(),
## SE_T006_001 = col_double(),
## SE_T006_002 = col_double(),
## SE_T006_003 = col_double(),
## SE_NV007_001 = col_double(),
## SE_NV007_002 = col_double(),
## SE_NV007_003 = col_double(),
## SE_T011_001 = col_double(),
## SE_T011_002 = col_double(),
## SE_NV011_001 = col_double(),
## SE_NV011_002 = col_double()
## )
new_HI$GEOID<- as.integer(new_HI$GEOID)
CB_map$GEOID<- as.integer(CB_map$GEOID)
merge2 <- left_join(CB_map, new_HI, by="GEOID")
merge2$STATEFP <- as.integer(merge2$STATEFP)
final_map <- merge2 %>%
filter(STATEFP != 02) %>%
filter(STATEFP != 15) %>%
filter(STATEFP != 60) %>%
filter(STATEFP != 66) %>%
filter(STATEFP != 69) %>%
filter(STATEFP != 72) %>%
filter(STATEFP != 78) %>%
filter(STATEFP != 79)
cb <- merge2 %>%
aggregate_map(by = "STATEFP")
tm_shape(final_map, projection = 2163) +
tm_polygons("No_Insurance", palette = "PRGn", showNA = TRUE, border.col = "gray50", border.alpha = .4) +
tm_shape(cb) +
tm_borders(lwd = .36, col = "black", alpha = 1) +
tm_layout(panel.labels=("Persons W/O Health Insurance in the U.S., 18 - 64yrs (2014)"),legend.position = c("left","bottom"))
After mapping the total violent crime rates by county and certain health issues, namely concerning behaviors and health insurance access, the data does not show a distinct relationship between healthcare access/affordability and violent crime rates. However, looking at data by specific neighborhoods, where crime is especially prominent, it reveal some interesting relationships between healthcare and crime. I would like to conduct research on neighborhoods high in robberies and property theft are also more likely to not have health insurance or access to doctors.