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.

21. California

> Violent crime rate: 396.1 per 100,000 (17th highest)
> Murder and non-negligent manslaughter rate: 4.4 per 100,000 (22nd highest)
> Median household income: $61,933 (9th highest)
> June unemployment rate: 5.4% (15th highest)

Violent crime in California is slightly more common than it is across the country as a whole. Violence is particularly problematic in California cities. Well over half of the state’s 26 major metropolitan areas have a higher violent crime rate than the national rate, with Stockton, a city with 750 reported violent crimes each year for every 100,000 residents, in the lead. Violence put San Bernardino, California in the national spotlight in December 2015 when a self radicalized state employee opened fire at an office party, perpetrating the nation’s deadliest mass shooting of that 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.

Click here to read our methodology.