This repository contains the final project for STAT 650 (Advanced R for Datascience), completed as part of my Master’s program in Statistics. The project demonstrates the application of data cleaning, visualization, modeling, and inference techniques using R. It involves an end-to-end statistical workflow from exploratory data analysis (EDA) to extracting meaningful insights from real-world data.
NICS (National Instant Criminal Background Check System) is the system through which people undergo checks before acquiring a firearm. NICS is a national database maintained by the FBI. NICS checks are point-of-sale background checks that happen each time a firearm is purchased. NICS searches criminal and mental health history and other records to determine if the person is legally prohibited from owning a firearm.
The dataset covers the time period from January 2017 to December 2021, providing monthly background check data for each U.S. state and firearm category.
Each column represents the type of transaction submitted to the National Instant Criminal Background Check System (NICS).
This project requires R (RStudio environment) and the following R libraries installed:
tidyversedplyrggplot2readxlRColorBrewerlubridateforcatsreadrscalescorrplot
- What is the overall trend of different firearm type permits (Declining or Rising in US) across 2017-2020 ?
- Are handguns replacing long guns in popularity over time (2017-2021) ?
- In which year did the United States experience the peak in total firearm-related permit background checks and what might this indicate about public sentiments?
- What are the top 10 states with the most and least gun permits across US (2017-2021) ?
- Which state had the highest total background checks for handguns, long guns, other guns and multiple firearm types from 2017 to 2020?
- Which states had the highest number of firearm permit background checks from 2017 to 2020?
- Is the “Other” firearms category growing, and what might this suggest about trends in niche/tactical firearms?
- Do permit rechecks (renewals or ongoing monitoring) vary significantly across states, and what does this indicate about state-level firearm monitoring systems?
- Do states with high handgun background checks also have high firearm-related incidents (crime/suicide)?
- The above line graph suggests that gun interest, particularly in handguns permits rose tremendously in 2020, which might be due to COVID'19 Pandemic or Election Year uncertainty or economic insecurity, but at the moment we are not sure and this is only a speculation. We can clearly see that there is a huge and growing demand for personal protection among american people. However, the apparent decline in Permits background check may be due to the reporting differences or perhaps state level permit checks which are not reported to NICS rather than a true decline in gun permit background checks. We will be investigating and explaining this in more detail in the next analysis.
- From the line graph, we can clearly see that the graph has an upward trend which means handguns are becoming more and more popular which may suggest that more American people are purchasing handguns for self-defense. We also see a spike in ratio starting in year 2020, likely to be triggered by political uncertainty, and the COVID-19 pandemic as claimed previously. However, it's important to point out that this remains speculative and cannot be confirmed solely from this data alone. This trend could reflect changing attitude towards self defense and concerns around personal safety. The linear regression line also shows a gradual increase in the HG/LG ratio which confirms a shift in preference toward handguns. In conclusion, our previous claim is further strengthened through this analysis that handguns are getting more popular among American population than long guns.
- The combined permits analysis confirms that the year 2020 actually experienced the highest number of total firearm-related permit background checks, which includes both standard and administrative types. This trend likely reflects increased public concern for safety, as well as an increased desire for security and firearm access during a year marked by the COVID'19 pandemic, protests, and political uncertainty. The continued high levels in 2021 (near the end of 2020) suggest that this was not because of only one factor but due to a combination of various factors which contributed to this extent of growth and firearm demand from the public. This pattern further supports our previous hypothesis that external crises trigger increased gun interest.
- State of Kentucky has the most permits by state, followed by California and Texas. Kentucky recorded the highest number of total permits rechecks in 2017–2018 because it is the only state that requires monthly automatic rechecks of its concealed carry permit holders. This is why the state of Kentucky permit counts are so highly inflated, which does not represent a true picture. Now we will move on to analyzing the states with the least total gun permits across US. The state with the lowest total gun permits is Vermont. After searching online about Vermont I found out something interesting which makes sense: Vermont has close to zero total permits because the state does not require gun permits because it has “constitutional carry (permitless carry),” allowing residents to carry handguns without a permit, and it has historically had permissive gun laws, therefore the results from our analysis aligns with the real-world. The state of Vermont has historically had very minimal restrictions on firearms. For example, there is no permit required to purchase a firearm.
- Florida: From the above analysis we can conclude that Florida leads in Handgun background check permits with approximately 2.9 million permits, which tells us that Florida is a gun-friendly state and the state policies of Florida encourages handgun purchases for people for self-defense. Moreover, a high rate of civilian handgun ownership indicates that people in Florida are well equipped for self defense.
Texas: As expected Texas is famous for its gun culture and leads in both categories of "Long Guns" and "Multiple-Gun "purchases suggesting a supportive culture of firearm ownership which includes rifles, and shotguns for hunting or sporting or gun collection. Furthermore, the "Multiple" category points to higher number of purchases of multiple guns by Texans and they are surely not to be messed with.
California: California leads in the 'Other' category which may include (e.g silencers, grenades, etc). This aligns with California's strict gun laws and regulatory system which requires permits for even unusual firearms which are not even guns. - State of Kentucky has consistently had the highest permits count in 2017-2019 with approximately 4.36 million permits in 2017, 4.65 million permits in 2018 and 1.78 million permits in 2019. However, in the year 2020 North Carolina state has showed the greatest number of permit count. One notable observation is that, the total permit count of Kentucky is extremely higher than other states therefore we will have to investigate it further to find out why. After thoroughly researching and reading articles and news online, I learned that the state of Kentucky runs monthly permit rechecks through the NICS (as per FBI documentation). That means every month, existing permit holders are rechecked which explains the significantly higher counts of permits for state of Kentucky as the total permits are artificially inflated and now the high numbers starts making much more sense. Therefore, the high numbers in Kentucky do not reflect demands of new permits issued, but rather existing monthly administrative background checks. On the other hand, North Carolina in 2020 gives a more realistic number for background checks for new permits as compared to Kentucky.
- From the plot, we can clearly see a very sharp rise in Other Permit Category ratio which suggests increasing consumer interest in non-traditional firearms, possibly driven by trends in regulatory gaps. The "Other" category includes firearms that don’t fit legally into traditional handgun or long gun classifications, which can create loopholes in firearm regulation and oversight. These types of other weapons like AR-styled pistols, pen guns, ghost guns, and silencers are extremely dangerous and can often bypass stricter regulation due to technical definitions. People may acquire these weapons without the same scrutiny applied to traditional handguns/rifles and can misuse them in criminal activities, as parts can be disposed off easily. If this growth continues unaddressed, the "Other" category could become a major source for illegal firearm possession and criminal misuse because regulatory laws are outdated with loopholes and there is limited public knowledge about these weapons. This is a very alarming situation and this category may evolve into a regulatory blindspot in future, essentially undermining public safety efforts and law enforcement investigations. Therefore, addressing this now with targeted policies and strict gun-control policies is not only realistic but extremely essential for national security and preventing future crimes.
- This is a very critical question because states which conduct frequent gun permit rechecks may indicate better monitoring system and stronger public safety systems, while other states may only do one-time background checks. We can also see there is a huge variation in how different US states conduct permit rechecks. As previously seen, Kentucky again dominates in average permit recheck ratio as compared to all other states with a huge margin. This is likely due to the automated monthly rechecks of all permit holders which shows a very strict and effective monitoring system. An interesting observation is that Indiana comes 2nd in terms of highest average recheck ratio and is also quite close to Kentucky. In contrast, many other states shows low permit rechecking ratio, potentially pointing to weaker monitoring systems, and should be strengthened and better controlled for public safety. Lastly, states with average recheck ratio close to 1 indicates these states likely perform only one-time checks at issuance. From the graph we can observe that the worst performing states with respect to average recheck ratios are Delaware, District of Columbia, Florida, Missouri, Nevada, New Mexico, Texas, Vermont, Virgin Islands and Georgia. These worst performing states indicates that they lack proactive monitoring systems for permit rechecks, which raises serious public safety concerns, policy gaps, therefore suggesting major policy and regulatory changes to control firearm permits.
If we were to compare the states safety of Kentucky with the worst performing states (in terms of average recheck ratio) then we can see that Kentucky turns out to be a much safer state in most aspects with majority of the worst performing states like New Mexico, Georgia, Nevada, Delaware, Florida, etc. Kentucky's permit recheck system is likely contributing positively to its relatively better safety metrics, which may suggests some association. However, causation cannot be established at this point because many other factors influence crimes and safety such as poverty, criminal justice, demographics, and many more. In conclusion, states with weak monitoring systems should consider more active permit rechecks because even partial increases in permit recheck frequency could help in reducing crimes, gun deaths and ultimately contribute to enhanced public safety.
- This is a very important question which needs to be addressed, by examining whether states with more handgun background checks also experience higher firearm death rates because I personally believe handgun access is a critical factor in both firearm crimes and suicides. Therefore, lets investigate it. From the analysis of 2017-2020 FBI NICS Total Handgun background checks and CDC firearm mortality death rates, we can see a slight positive relationship (r ~ 0.03) which is almost negligible and we find no meaningful correlation between Total handgun checks vs firearm mortality death rate. This could be explained because the high handgun background check does not necessarily means that people are owning greater number of handguns, it is merely a background check and does not confirms whether a gun was sold or not. Therefore, higher handgun background checks alone does not directly cause higher firearm mortality deaths. Additional factors such as state regulations, permit rechecks, illegal sales, mental health accessibility, and economic conditions likely play a more bigger role. Lastly, few outlier states like California, Florida, Texas, Pennsylvania, Alabama, and Mississippi could also be observed.
California:
California state shows an interesting pattern of very high handgun background checks but lower mortality death rate. This could be explained due to California's stronger state regulations with respect to guns and better enforcement of law and order. This might also be due to better mental health infrastructure and better knowledge of gun usage among the public.
Mississippi and Alabama:
Both states show low to moderate handgun background checks but extremely high mortality death rate. These might suggest illegal or private sales of guns and weaker gun regulations in these states which needs to be addressed.
Pennsylvania, Texas and Florida:
These states show the highest handgun background checks but moderate firearm death rate, which might suggests somewhat strict regulations and gun laws due to which crimes are controlled. Furthermore, it might also have to do with better mental health resources and ease of accessibility for suicide or mental health illnesses.
- The FBI’s National Instant Criminal Background Check System (NICS) counts initiated background checks, not the number of firearms sold. Therefore, a one-to-one correlation cannot be assumed.