Americans take into consideration a number of factors when deciding where to live, including the quality of schools, the strength of the local economy and job market, the area’s safety and culture, as well as its climate. Cities that perform well by these measures are more likely to attract new residents, and those that do not tend to drive residents away.

Comparing entire cities to each other can be problematic, particularly since living conditions can vary from one neighborhood to the next. Still, as much as a city can be judged on the whole, some cities face widespread problems that detract from residents’ overall quality of life.

17. Kentucky
> Worst city to live: Louisville/Jefferson County
> Population: 615,389
> Median home value: $145,000
> Poverty rate: 16.7%
> Adults with at least a bachelor’s degree: 30.1%

Although Louisville’s 4.9% 2015 unemployment rate is lower than the state’s 5.4% rate, it may not remain that way for long. The city lost 1.3% of its jobs between 2013 and 2015 — a steeper employment decline than in all but a few major U.S. cities. High crime rates in the area may be taking a toll on the local economy. There were 632 violent crimes — murder, rape, robbery, and aggravated assault — for every 100,000 Louisville residents in 2015, nearly triple the state’s violent crime rate that year.

Louisville residents also cope with more air pollution than most Americans. Air quality is considered hazardous for at least part of about 8.8% of days a year, compared to an average of 5.9% of days nationwide.

American cities are often held to the standards of national averages, or against all of the other cities in a country. However, for the residents that actually live in these places, a more appropriate point of comparison are those cities that can be found nearby, in the same state.

To determine America’s worst cities to live in each state, 24/7 Wall St. reviewed data on the largest U.S. cities. Based on a range of variables, including crime rates, employment growth, access to restaurants and attractions, educational attainment, and housing affordability, 24/7 Wall St. identified the worst city to live in each state.

Click here to see the worst city to live in every state.
Click here to see our detailed findings and methodology.