Average Firearm Mortality by Law Strictness Bin:
likert_score likert_label mean std count
0 1 Most Lax 21.84 4.991148 10
1 2 Moderately Lax 20.60 3.182941 10
2 3 Moderate 14.12 2.369154 10
3 4 Moderately Strict 14.01 2.660597 10
4 5 Strictest 7.64 4.276343 10
Do Stricter Firearm Control Laws Help Reduce Firearm Mortality?
Knowledge and visualΒ analytics - DATA608β
Professor: Peter Kowalchukβ
CUNY, SPSβ
Research question: Do stricter firearm control laws at the state level correlate with lower rates of firearm-related mortality?β
OBJECTIVES β
CATEGORIZE states by gun law strictness β
β 5-point Likert scale (Most Lax to Strictest) β β
ANALYZE firearm mortality rates β
β CDC Public Endpoint (2023 data)β β β
COMPARE law strictness vs.Β mortality β
β Identify patterns and correlations
METHODOLOGY β
π DATA SOURCES: β
Gun law rankings: Giffords Law Center (2023) β
Mortality data: CDC National Center for Health Statistics (2023) β via data.cdc.gov β
π TOOLS:β Python (Pandas, Plotly, Matplotlib, BeautifulSoup)β
Interactive HTML exports for presentation β β
APPROACH: β
Scrapped Giffords rankings β assigned β Likert bins β
Fetched CDC mortality data by state β
Merged datasets on state name β
Created interactive choropleths & bar charts β
Analyzed trends across Likert categories β
5-Point Likert Scale of Gun Law Strictness
Firearm Mortality Rates Across the United States
Check neighboring states of IL (score 5) to see if they also have high scores
state state_abbr likert_score likert_label mortality_rate
4 Missouri MO 1 Most Lax 23.7
15 Kentucky KY 2 Moderately Lax 18.3
16 Indiana IN 3 Moderate 18.0
27 Illinois IL 5 Strictest 14.4
31 Wisconsin WI 3 Moderate 13.9
36 Iowa IA 4 Moderately Strict 12.0
This shows that IL (strict) has a much lower mortality rate than its neighbors IN, MO, KY (all lax) β despite similar geography and demographics. This is a strong visual example of how law strictness correlates with mortality, even in the same region.
Comparing the two maps side by side
Comparing Gun Law Strictness and Firearm Mortality
***Mississippi, Alabama, Louisiana, Arkansas β theyβre dark on the LEFT (lax laws)
AND dark on the RIGHT (highmortality). Geography is not a coincidence β itβs the pattern.β* β Border States Tell the Story β Missouri 23.7 vs Illinois 14.4, Same Geography Different Lawsβ**
HEATMAP: Likert vs mortality from Most Lax to Strictest
What we have accomplished:
This notebook successfully merges firearm mortality data with gun law strictness scores, creating a comprehensive dataset for analysis. The visualizations, including a Likert scale table, a US heatmap of mortality rates, and a side-by-side comparison of strictness vs. mortality, effectively communicate the relationship between gun laws and firearm deaths across the United States. The enhanced bar chart and heatmap provide clear insights into how stricter gun laws correlate with lower mortality rates, supporting the narrative of the presentation. The use of interactive Plotly figures allows for engaging exploration of the data, making it suitable for a compelling presentation on the impact of gun laws on firearm mortality.
Key Findings:
- Clear Correlation: There is a noticeable correlation between gun law strictness and firearm mortality rates. States with stricter gun laws tend to have lower mortality rates, while those with more lax laws show higher rates of firearm-related deaths.
- Significant Differences: The bar chart reveals a significant gap in average mortality rates between the most lax and strictest states, highlighting the potential life-saving impact of stricter gun legislation.
- Geographic Patterns: The heatmap and US map visualizations show geographic patterns in both gun law strictness and mortality rates, with certain regions (e.g., the South) exhibiting higher mortality and more lax laws, while others (e.g., the Northeast) show the opposite.
- Policy Implications: The data suggests that implementing stricter gun laws could be associated with reductions in firearm mortality, providing evidence for policymakers advocating for stronger gun control measures.
βThe data suggests an association between stricter gun laws and lower firearm mortality rates. While causation cannot be established from this analysis alone, these findings are consistent with existing literature suggesting that stronger gun legislation may contribute to reductions in firearm-related deaths.β