Although the risk of deadly shootings appears to have escalated, violence in the United States is trending downward. In 1995, there were 685 violent incidents per 100,000 people nationwide. By 2014, the national violent crime rate had fallen to 366 violent crimes per 100,000 people. The United States is far from the most peaceful place on earth, however, and some states remain far more violent than others.

24/7 Wall St. generated an index to rank the peacefulness of each U.S. state. States with high violent crime and homicide rates, as well as high estimated small arms ownership and high incarceration rates were identified as less peaceful, while states with lower incidences of these factors were more peaceful. According to our index, Maine is the most peaceful state, while Louisiana is the least peaceful.

In an interview with 24/7 Wall St., Dr. Nancy La Vigne, director of the Urban Institute’s Justice Policy Center, made clear that states are not simply violent, or peaceful. Rather, they fall onto a continuum. This is partially due to the fact that the concentration of violence varies so much geographically, even within states.

“Even within cities that tend to have higher crime rates and even within neighborhoods that are well known to have lots of violent crime, there are pockets of peaceful streets and pockets of violent ones,” La Vigne said.

By some measures, Pennsylvania does not rank as particularly peaceful or particularly violent compared to all states. However, if the number of mass shootings is any indication of a state’s overall tendency, then Pennsylvania is somewhat peaceful — at least relative to its size. The state recorded only three mass shootings — shootings with four or more victims — so far in 2016. Pennsylvania is the sixth most populous in the country, yet 21 states have had at least four mass shootings so far this year.

A slew of factors contribute to violence in a community. La Vigne noted that many factors are involved and anything from low incomes and the presence of 15 to 25 year old men to a combination of environmental conditions can help explain unrest in an area. “Vacant housing, burned out streetlights, signs of disorder … can predict where crime might be more concentrated,” she said.

In the vast majority of the nation’s more peaceful states, households earn higher incomes, while incomes tended to be much lower in more violent states. Of the 25 states on the top end of the peacefulness ranking, only five have poverty rates higher than the national rate of 15.5%. Of the more violent half of states, poverty rates tend to be higher.

A perfectly peaceful community would have no need for weapons or law enforcement workers. Of course, some number of police officers are needed to keep the peace even in the least violent areas. Past a certain threshold, however, large enforcement operations are features of less peaceful states. The ratio of law enforcement employees to state residents exceeded the national proportion of 282 law enforcement workers per 100,000 Americans in eight of the 10 least peaceful states. On the other hand, all but two of the 10 most peaceful states had proportionately smaller police forces.

The connection between law enforcement and peaceful society is not yet completely understood. Crime continued to drop in the United States during the most recent economic downturn, even as police spending dramatically fell. Also, whether more policing equals greater peace largely depends on what police are doing. La Vigne gave the example of aggressive stop-and-frisk tactics, which frequently alienate law-abiding citizens who might otherwise have aided in crime prevention.Click here to see America’s most violent (and peaceful) states.