This data set contains the list of polls about guns.This contains data about gun topics and what stances do Republican and Democrats support. This poll quiz was taken after the school shooting in Parkland Florida.
My Question of interest is to see which issues do both Republicans and Democrats strongly support.
## Read the csv file directly from Github
gundata <- read.csv("https://raw.githubusercontent.com/fivethirtyeight/data/master/poll-quiz-guns/guns-polls.csv" ,header=TRUE ,sep=",")
gdata <- as.data.frame(gundata)
## Look at the head of the data and see what it contains:
head(gdata)
## Question Start End Pollster Population Support
## 1 age-21 2/20/18 2/23/18 CNN/SSRS Registered Voters 72
## 2 age-21 2/27/18 2/28/18 NPR/Ipsos Adults 82
## 3 age-21 3/1/18 3/4/18 Rasmussen Adults 67
## 4 age-21 2/22/18 2/26/18 Harris Interactive Registered Voters 84
## 5 age-21 3/3/18 3/5/18 Quinnipiac Registered Voters 78
## 6 age-21 3/4/18 3/6/18 YouGov Registered Voters 72
## Republican.Support Democratic.Support
## 1 61 86
## 2 72 92
## 3 59 76
## 4 77 92
## 5 63 93
## 6 65 80
## URL
## 1 http://cdn.cnn.com/cnn/2018/images/02/25/rel3a.-.trump,.guns.pdf
## 2 https://www.ipsos.com/en-us/npripsos-poll-majority-americans-support-policies-aimed-keep-guns-out-hands-dangerous-individuals
## 3 http://www.rasmussenreports.com/public_content/lifestyle/general_lifestyle/march_2018/americans_favor_raising_age_to_buy_gun_not_enlist_or_vote
## 4 http://thehill.com/opinion/civil-rights/375993-americans-support-no-gun-under-21
## 5 https://poll.qu.edu/national/release-detail?ReleaseID=2525
## 6 https://d25d2506sfb94s.cloudfront.net/cumulus_uploads/document/zq33h2ipcl/econTabReport.pdf
myvar = c("Question","Population","Republican.Support","Democratic.Support")
Rtable <- gdata[myvar]
## See which issues Republicans are interested in...
## See which issues do Republicans support over 75%
R <- subset(Rtable,Republican.Support > "75")
R
## Question Population Republican.Support
## 4 age-21 Registered Voters 77
## 12 arm-teachers Registered Voters 77
## 13 arm-teachers Registered Voters 80
## 14 background-checks Registered Voters 97
## 15 background-checks Registered Voters 78
## 16 background-checks Registered Voters 76
## 17 background-checks Registered Voters 88
## 19 background-checks Adults 89
## 20 background-checks Registered Voters 91
## 40 mental-health-own-gun Registered Voters 87
## 41 mental-health-own-gun Registered Voters 81
## 42 mental-health-own-gun Registered Voters 89
## 43 mental-health-own-gun Registered Voters 84
## 44 mental-health-own-gun Adults 88
## 45 mental-health-own-gun Registered Voters 91
## Democratic.Support
## 4 92
## 12 10
## 13 11
## 14 99
## 15 87
## 16 91
## 17 90
## 19 99
## 20 91
## 40 84
## 41 86
## 42 90
## 43 78
## 44 96
## 45 91
According to the data it seems they are fully support background check,mental health with gun ownership and allowing teachers to arm themselves very interesting…
## Next is the plot..
library(ggplot2)
## Warning in register(): Can't find generic `scale_type` in package ggplot2 to
## register S3 method.
ggplot(R) +
geom_boxplot(mapping = aes(x=Question,y=Republican.Support)) +
labs(title= "Gun Issues Republican mostly Support",x="Question asked", y = "Republican Support")
According to the data we can see there is a lot of variability for background-checks with the median being around 88% it seems this category is slightly skewed around 80% percent with the min being 82% and the max 90%.There appears to be a strong consensus among Republicans for the people that are mentally ill should not be allowed to own a gun with the median being 87%. It seems that among Republicans the key issues they actually care about are age for gun-ownership,whether the mentally ill should be allowed to own guns,stronger background checks and whether teachers should be allowed to arm themselves.
## Here I edited the issues into shorter names since the names
## couldn't fit into the graphs
D <- subset(Rtable,Democratic.Support>"75")
D[D == "background-checks"] <-"bg-chks"
D[D == "ban-high-capacity-magazines"] <-"mag-ban"
D[D == "stricter-gun-laws"] <- "stricter_laws"
D[D == "ban-assault-weapons"]<-"assault_ban"
D[D == "mental-health-own-gun"] <-"mental_heal"
##Box plot of the issues Democrats want solved
library(ggplot2)
ggplot(D) +
geom_boxplot(mapping=aes(x=Question,y=Democratic.Support)) +
labs(title ="Gun Issues that Democrats strongly support",x="Issues that Democrats support", y="Democrats Support")
The democrats appear to strongly support a lot of issues with the highest median being background checks. It also appears most Democrats want the age of gun ownership to be increased to 21 where the min is around 83% and the max is around 94%, the data here appears to be skewed towards the 90% suggesting very strong support for this issue.A note of interest is the outlier on stricter gun laws with it’s value being around 76% or 77%.
It seems the Democrats are passionate on reforming gun laws compared to their Republican counterparts. The democrats strongly want to reform a lot of guns law that include banning high-capacity magazines, and banning assault weapons which many Republicans do not support. There is also not many support among Republicans for raising the age for gun ownership. Though there is a common agreement for stronger background checks and assessing the mental health of people before allowing them to own a gun. All in all the data seems pretty consistent with today’s political climate regarding gun reforms, where democrats are more leaning towards stronger gun reform than republicans.