Gun Violence in the United States

Posted on Apr 27, 2019


Gun control and possession rights is one of the most controversial topics in the United States, mostly because of the associated violences and crimes that come with having guns as a weapon. It is difficult to find statistics on gun violence and crime without the bias of third party organizations.

The goal of this app is to help the user visualize trends in gun violence incidents though various observations without bias. With a more broad understanding of the trends of gun violence, we can see where to actively target certain areas to help decrease the amount of gun violence in the future. 



This dataset is sourced from Kaggle. The dataset is derived from web scrapping techniques on another third party site, . I, and NYC Data Science Academy, do not own this dataset or was involved with web scrapping it. For more information, please visit the provided links.

To aid in the analysis of this dataset, I used the Annual Estimates of the Resident Population for the United States, Regions, States, and Puerto Rico: April 1, 2010 to July 1, 2018 table. This gave the population size for each state, including the District of Columbia, to help accurately compare crime rates.


The dataset is 230,000+ gun related incidents that have been recorded on all states since March 2013, up to March 2018. This dataset was joined with population data in R Studio. The joined table was further cleaned with added columns for analysis. 


We first start with a couple of overview plots to get a general idea of the dispersion of gun related crime incidents. 

We have a map of the continental US with markers for the locations of incidents based on the number of effected people. Affected people represent the number of people that were killed or injured during the event. The user is to select the number of affected persons per a given incident from the dropdown menu. We see in the image below the places with incidents with 3 affected persons.

The US Chart tab contains a chart of the number of incidents per every 100,000 people in each state. This chart takes into account population sizes in each state so that the number of incidents can be compared on an equal basis. We see below that the place with the most number of incidents is the District of Columbia, with 147.68 incidents per every 100,000 people. 

While this is a shockingly high number, DC is known for having incredibly high crime rates, mostly due to various drug wars and the striking wealth gap.  


The user is allowed to pick a state and look into the distribution of incidents for that state. Among the options include looking at the number of incidents from the years 2014 to 2017, as well as looking at the number of incidents by city or county. Only the top 20 cities/counties with the highest number of gun violence incidents are shown. Note: District of Columbia does not have counties and cities. Although these numbers are not normalized by population in each city/county, cities with the highest number of people were NOT the places with the most number of incidents. Below, we see that in California, the city with the highest number of gun related incidents is Oakland, easily outdoing higher population areas like Los Angeles and San Francisco. 

Furthermore, users can investigate the number of incidents and the number of homicides due to gun violence by month to examine the change in seasons. In the graph below, we can see a peak in the summer months for the number of gun related incidents in Connecticut in 2016.


In conclusion, this gun violence dataset gives us a broad overview of what gun related incidents look like around the United States. We are able to see some interesting results that may contradict some previous assumptions. Ultimately, I believe this dataset will be useful for people to get some solid insight on gun violence. 

About Author

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp