Explaining gun violence in the United States
Aims: The homicide rate in the US is more than seven times greater than in other industrialised economies. In 2020, nearly 80 percent of US homicides involved firearms. This project aims to answer why the US is one of the worst high-income countries in preventing firearm mortality, whilst highlighting the importance of the arms industry within the US labour market.
I used Python to scrape data from the Pew Research Centre which showcased gun violence as a very problematic issue for nearly half of the American population (48 percent).
This visualisation required concatenating data from multiple scraped tables, replacing missing values and changing the data to long form using the ‘pd.melt’ command. This research will now demonstrate my investigation into the causes behind the concerns of gun violence.
In order to examine and compare the US’s high rates of gun violence, I used Python to batch download API links using a loop on the firearm related death rates for the world’s largest advanced economies.
In contrast to the other G7 countries, the US has had more than double the death rate from firearms across the years. The reason for the missing data is that the API source can only display data for the most recent year for which the data has been published. Some countries often lag several years behind high-capacity countries such as the US. Others (perhaps France) are waiting for the API source to undergo their ongoing country-by-country data sweeps. Since this dataset required cleaning, this visualisation does not benefit from a quick and reliable automatic update when this free sign-up accessible API source updates.
To understand the associated economic costs of US gun violence, I attempted to scrape the webpage EveryStat. However, the 403 Forbidden error code denied my request of wanting to scrape the website. Therefore, I inspected the network activity to find an external data source, and I utilised the 'Get Data' function in Excel to scrape this data and cleaned it in Python.
This chart outlines a map of the US and illustrates that the average economic cost per capita amounts to $557.2 billion each year. The cost of gun violence ranges from police investigations to the quality of life lost and is approximately 2.6 percent of the annual US gross domestic product (GDP).
To leverage the restrictive and permissive gun laws across states, I utilised the gun-friendly index data from AZ-Defenders. I inspected the network activity to find a subpage and merged this dataset with the CDC firearm death rate data.
The regression in Python illustrates a one unit increase in the gun-friendly index results in the death rate per 100,000 rising by 0.15. A state with lenient gun laws tends to have higher firearm mortality. The gun-friendly index was based on various factors ranging from how lenient the background checks are to the state-level gun culture. An R^2 of 0.50 suggests that 50 percent of the variability in the death rate is explained by the gun-friendly index.
The restrictive firearm regulations would impact the gun ownership level across states. Hence, I scraped data from the webpage Wisevoter using Python to establish a potential firearm relationship between mortality and ownership.
This regression demonstrates that a one percent increase in firearm ownership increases the death rate per 100,000 by 0.31, with an R^2 of 0.55.
For the final correlation, I wanted to establish whether both average income and a highly educated population influence firearm mortality. Hence, I utilised the web-scraping tool ‘Beautiful Soup’ to scrape the specific tables of interest and looped through all the table content for the percentage of people with a bachelor’s degree or higher and the average earnings per state.
The Python regression analysis indicates a negative relationship between education and death rate, and between income and death rate. However, there is a positive correlation between education and income.
A solution to firearm mortality may be to prohibit gun sales. However, the arms industry was important to the US GDP of $22,996.1 billion, contributing a total of $70.52 billion (0.31 percent) in 2021. To access this data, I scraped a PDF report by NSSF using Python.
This chart merged the scraped data with a topoJSON file of the US map in Vega. In 2021, the US had a total of 6,300,000 people unemployed. Therefore, the 375,819 jobs provided in this sector with an average wage of $56,900 is crucial for the livelihood of these Americans.
Conclusion: The influence of the arms industry on the labour market may be considered minimal in relation to the damage caused by firearms. Whilst this supports the abolition of gun sales, this could induce other criminal activity and further study is needed to weigh the cost and benefits of ceasing firearm sales.