Gun Violence In America

Kevin Cannon
Posted on Jul 30, 2018


Gun control is a politically divisive topic with people committed to strong opinions on the matter. But what does the data tell us?  I decided to take a look myself using the following Kaggle dataset:

The dataset itself is a database of individual incidents, complete with the date and location of the incident, the number of people involved, and the relationship between the suspects and victims.  A full analysis of all the information contained in the dataset would surely produce valuable insights, though it would be a massive undertaking beyond the scope of the project. Consequently, I decided to narrow my focus on only the time and space dimensions.  Furthermore, because the data contains incidents for the years 2013 through 2018, but the data for 2013 is sparse and 2018 is incomplete, I decided to omit those years from the analysis.

Across Time

To visualize gun violence over time, I created calendar plots with heat map shading that indicates the severity of deaths per capita (as measured by the number of deaths per 1m residents) and the number of incidents.  The most striking result is the sheer ubiquity of gun violence in America; in the 4 years from 2014 - 2017, there were only 4 days on which there were no incidents, with the average number of incidents per day at around 100:

Of course, the violence is not spread evenly across the country; some states are plagued by more gun violence than others.  For example, despite having half the population of California, Florida has roughly the same number of incidents per year:

Perhaps the city with the worst problem with gun violence is Chicago, and the despite the fact that Illinois has a third of the population of California, it has a substantially higher number of incidents:

Chicago is home to Illinois's Congressional District 7, which is most affected by gun violence; disturbingly it has a similar number of daily incidents as the entire state of Pennsylvania:

In terms of the number of deaths per capita, the states with the worst problems with gun violence are Arizona, Nevada, Alabama, and California:

Across Geography

Because the dataset included the congressional district in which each incident occurred, I wanted to see what, if any, relationship gun violence had with party affiliation.  Below are maps of the continental United States for each year where congressional districts are colored by party (Blue for Democrat, Red for Republican, and Green for DC), and the shade of the color is proportional to the severity of gun violence as measured by the number of deaths per capita:

While the maps don't change very much from year to year (and it is thus difficult to glean insight from their progression), it is interesting to note that some of the congressional districts with the most severe gun violence are also heavily gerrymandered.  One possible explanation for this could be that gun violence is more common among lower socioeconomic classes with higher proportions of minorities, which tend to vote Democratic, and that the relevant congressional district borders were drawn to minimize representation of this demographic.


This analysis was only a cursory first look at a dataset that is rich with information and could potentially provide valuable insight to help better understand the causes, effects, and potential solutions to a very real - and very serious - problem facing our country.





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 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