After 31 people were murdered in back-to-back shootings in El Paso, Texas, and Dayton, Ohio, last month, President Donald Trump declared, "Mental illness and hatred pulled the trigger. Not the gun." His claim, a twist on the gun-rights adage that “Guns don’t kill people, people kill people,” is a popular refrain, with little evidentiary basis.

WIRED OPINION ABOUT Joseph Pomianowski is a Yale Law School graduate and conducts research at the Polish Academy of Sciences. Ling Liang Dong is a recent Yale University graduate and currently conducts research at Microsoft Research NYC.

A 2013 Gallup poll found that almost half of respondents viewed mental illness as “a great deal to blame” for mass shootings, although there is no data to support a causal link between mental illness and gun violence. Fewer respondents blamed other factors like gun access, despite the fact that limiting access has a well-established, strong correlation with reduced gun accidents and deaths. More recent polls have revealed that similarly uninformed sentiments remain.

Frustrated by the sparse studies on the subject, we dug into the data from 22 unique gun law policies from the last decade to see which show the strongest correlation with gun injuries and deaths. To measure the strengths of each law, we used data on state gun policies provided by the Giffords Law Center and fatal injury statistics from the Centers for Disease Control’s web-based Injury Statistics Query and Reporting System.

For each gun policy, we ran two separate tests. First we calculated the simple pairwise correlations between the strength of a policy in a given year and corresponding fatal injury outcomes from the following year. Consistent with past research, we found that although mental health reporting laws are weakly associated with lower suicide rates, they showed no correlation with homicide rates. Decreases in fatal injuries were most strongly correlated with gun-access and gun-use restrictions, such as owner licensing requirements, gun dealer regulations, and local regulations that allow municipalities to pass their own firearms ordinances as an addition to state gun laws.

We also ran linear regression models to predict fatal injury rates from the strength of each state's gun policies, after controlling for differences across states and years. Again, many gun control laws—such as buyer background check and safe storage laws—significantly predicted lower suicide and homicide rates. Mental health reporting laws, on the other hand, did not. These results suggest that these more traditional gun control laws work.

To remove linearity constraints, we focused on homicides and fit a random forest regression model (a machine learning model that does not assume linear effects) with the gun control policy strengths for each state and year. This again identified a set of policies, which did not include mental health reporting laws, that each independently predicted lower rates of fatal injuries from homicides.

These findings underscore the need for the national debate on gun laws to be guided by real data, rather than convenient political maxims or easy compromises. Our findings align with existing literature in support of one clear conclusion: A set of fundamental gun control policies has consistently been strongly associated with lower rates of fatal injury, whether from suicides or homicides.

In the wake of the El Paso and Dayton shootings, several lawmakers joined Trump in pushing for a particular type of mental health-related gun law: “red flag” laws that would allow either individuals or law enforcement to petition courts to temporarily confiscate firearms from those who pose a threat to themselves or others. Senators Lindsey Graham, Chuck Grassley, and John Thune have joined the chorus, seemingly eager to chart a politically safe course on an otherwise hot-button issue. But conspicuously missing from the conversation is proof that red flag laws will actually reduce gun homicides.

Peer-reviewed studies have found that these laws are associated with lower suicide rates. While advocating for a decrease in suicide rates through gun laws is absolutely critical, our findings suggest that focusing on the implementation of more fundamental gun control laws will lead not only to a reduction in suicides but also in homicides. And as the CEO of the American Psychological Association's President said in response to Trump’s statement, "Blaming mental illness for the gun violence in our country is simplistic and inaccurate and goes against the scientific evidence currently available."