Amid the many high-profile mass shootings of recent years, there has been a familiar and mildly comforting refrain: that despite the awful headlines, gun violence is down from its early 1990s peak. Tragedies like Aurora, Newtown, and San Bernardino are horrific, this line of thinking goes, but the everyday carnage in America — while still extremely high, compared to other Western nations — has receded.

New data from the State Firearm Laws project shows that the reality is a little more complicated. Though the overall gun-homicide rate is indeed down over the last 25 years — and in some places down significantly — it actually ticked upward in 10 states, including New Jersey, Ohio, Pennsylvania, and Wisconsin.

And the picture for suicides, which constitute the majority of gun deaths, is even grimmer, with 20 states reporting increases between 1991 and 2016.

The State Firearms Law project, carried out by researchers at Boston University’s School of Public Health, tracks the number of gun regulations a state has adopted, including policies on concealed-carry permits, assault rifles, and domestic violence. It doesn’t attempt to assess which ones may be more or less effective than others in bringing down the homicide rate.

California has the most laws on the books, with 104, and Alaska, Idaho, and Montana have the fewest, with four. The average number of gun laws per state is 27.

The statistics show what appears to be a strong correlation between the quantity of gun regulations in a state and a lower rate of gun violence, particularly suicides.

The states with the lowest gun-suicide rates, which include Massachusetts, Connecticut, California, and Rhode Island, have all imposed far stricter rules than average. Massachusetts is home to the second-most regulations in the country — 100 out of a possible 121 — and boasts the lowest gun-suicide rate of any state.

States where suicides by gun rose, meanwhile, tend to have fewer gun regulations — and fewer people. Rural states like Alaska, which saw an almost 100 percent increase in gun suicides since 1991, lead the pack in this unfortunate trend, along with Montana, West Virginia, and Wyoming. Gun suicides are far more common than gun homicides in such states, and may be part of the wave of “deaths of despair” that has spread among the white working class.

The correlation between regulations and violence is fuzzier when it comes to homicides. California, one of the most strictly regulated states in the country, saw a stunning 60 percent drop in gun homicides over the last 25 years. New York, another state where it’s difficult to buy a gun, with 75 regulations, saw a 78 percent dip. Rhode Island and Illinois have also experienced sharp declines in homicides.

But there are also states that have rolled back gun regulations and have a low number of laws on the books that have also seen declines in homicide rates. One of these is Texas. The state isn’t exactly on the front lines of progressive gun policy — you can carry your handgun to your college biology class — yet its gun-homicide rate has plummeted 61 percent in the last quarter century.

As has been well-documented, much of the plunge in the national gun homicide rate took place in the mid-to-late 1990s, during which the rate was cut in half. In the years that followed, it stayed mostly level. It ticked up again in 2015, and likely increased again last year — final statistics aren’t out yet — driven by a ballooning gun-murder rate in a few cities. It’s unclear whether new regulations have done much to counteract this trend.

There are also lots of factors that almost certainly affect the gun-homicide rate that have nothing to do with firearm laws. States with low gun-homicide rates also tend to rank high in other quality-of-life rankings, like per-capita income and educational attainment, while states with the most gun homicides, like Louisiana, Mississippi, and Alabama, also rank near the bottom in such measures. There is also, typically, a wide murder inequality within states, and even within cities. In Chicago, for instance, the homicide rate in the dozen or so highest-crime neighborhoods is eight times higher than in the lowest-crime neighborhoods.

It’s difficult to separate out the effectiveness of gun laws from the inherent stability found in a wealthy, educated society versus the instability that is endemic to its opposite. In this sense, the disparity in the rate of gun deaths is reflective of the widening gap between the haves and the have-nots in America. With gun violence, as with so many other societal ills, residents in suburban Massachusetts and rural Louisiana may as well live in two different countries.