Thanks to continued improvement in public health care, Americans today are healthier than ever. The average American is expected to live 79 years, about six years longer than in 1975. The improvement, however, has not been uniform across the United States, and some cities are stuck in the past. In some of the least healthy cities, life expectancy is as low as it was 40 years ago.

To determine the least healthy cities in the country, 24/7 Wall St. compiled an index of various health factors and outcomes. Health factors in an area, including eating and exercise habits of residents, the availability of clinical care, social and economic conditions, and the physical environment, tend to be accurate predictors of an area’s health outcomes — its residents’ length and quality of life.

A large share of Beckley residents are relatively poor and lack access to resources necessary to maintain a healthy lifestyle. The typical household in the area makes just $38,606 a year, and only 47.2% of residents have adequate access to opportunities for physical activity, each some of the lowest figures in the country.

The city’s 22.9% smoking rate, 34.5% obesity rate, and 34.5% inactivity rate are also among the highest of any metro area. Beckley also leads the country in injury deaths, a leading cause of which is drug overdose. For every 100,000 metro area residents, 121 die of an injury, more than twice the national rate. Also, 553 Beckley residents per 100,000 die prematurely before age 75, the highest premature death rate in the country.

In Pine Bluff, 51.4% of children live in single-parent households and 44.4% of children live in poverty, the second and third largest such shares in the country. Such living situations can negatively impact the mental health of children. Pine Bluff also has among the worst teen birth and chlamydia rates nationwide.

Unhealthy behaviors are relatively common amongst Pine Bluff residents. The metro area’s 25.5% smoking rate, 36.2% inactivity rate, and 38.3% obesity rate are respectively the highest, second highest, and third highest such rates in the country. Also, 501 Pine Bluff residents per 100,000 die before the age of 75, nearly the highest premature death rate of any metro area.

A large share of Hammond residents are relatively poor and lack access to many of the resources necessary to maintain a healthy lifestyle. The typical Hammond household makes just $40,721 a year, and just 61.7% have adequate access to locations for physical activity, such as parks and recreation centers, each some of the lowest such figures in the country.

Clinical care in the area is also subpar. The metro area has fewer than half as many primary care physicians and mental health providers per capita than the country as a whole, and nearly the most preventable hospitalizations of any city. Coupled with the area’s unhealthy behavior — Hammond is the only city in which more than two in five residents are obese — Hammond is ranked as the third least healthy place in the country.

The average Mobile adult feels in poor mental shape for five days a month on average, far longer than the 3.5 days the average American feels in such a state. Poor mental health outcomes in Mobile may be tied to multiple unhealthy behavioral and socioeconomic factors in the area.

Mobile’s 36.1% obesity rate and 29.6% inactivity rate are both far higher than the corresponding national figures. Additionally, nearly one-fifth of area residents live in poverty, and 7.0% of the workforce is unemployed, each some of the highest such figures in the country.

Poverty can result in an increased risk of mortality, disease, depression, and unhealthy behaviors. Albany’s 26.8% poverty rate is the eighth highest of any metro area and likely hinders the ability of many residents to maintain a healthy lifestyle.

Only 63.8% of Albany residents have adequate access to places for physical activity, a much smaller share than the 84.0% national share. Access to food is similarly low — 31.8% of metro area resident do not have reliable access to food, one of the largest shares nationwide, which likely contributes to the high obesity and premature mortality rates among Albany residents.

According to the Centers for Disease Control and Prevention, up to 40% of deaths from the five leading causes are preventable. Premature death can often be prevented through changes to personal behavior. In every metro area in which a larger share of adults smoke, are physically inactive, and are obese than the country as a whole, the premature death rate is high and more years of potential life are lost due to premature death per capita than the national average.

Residents in many of the least healthy metro areas lack the means necessary to lead a healthy lifestyle. In an email with 24/7 Wall St., Amanda Jovaag, data lead at health advocacy group County Health Rankings & Roadmaps, said, “Income provides economic resources that shape choices about housing, education, child care, food, medical care, and more. As income and wealth increase or decrease, so does health.” In each of the least healthy metro areas, the typical household makes at least $4,700 less than the typical American household.

The number of primary care physicians, dentists, and mental health providers per capita can also dictate the availability of medical care and consequently affect health outcomes. The number of preventable hospitalizations is another indicator of the quality of a metro area’s health care system. In 24 out of the 25 least healthy cities, there are more preventable hospitalizations per capita than the national average of 54 per 1,000 Medicare enrollees.

Access to the health care system is perhaps as important as its quality. In many of the cities with the worst health outcomes, a large share of residents is uninsured. “Those without insurance are often diagnosed at later, less treatable disease stages than those with insurance and, overall, have worse health outcomes, lower quality of life, and higher mortality rates,” Jovaag said.

For a variety of reasons, rural populations tend to be less healthy than urban ones. “The reasons behind this difference are varied,” Jovaag said. “Certainly, resources such as access to clinical care and healthy foods play a role, but we also know that poverty and unemployment are more prevalent in rural counties.” Many of these factors contribute to the differences in health outcomes between rural and urban cities.

As part of a recent epidemic, deaths from drug overdose have been on the rise and have contributed to the first increase in the U.S. death rate in a decade. Injury deaths, a leading cause of which is drug overdose, disproportionately affect many of the communities on this list.

To determine the least healthy cities, 24/7 Wall St. created an index modeled after analysis conducted by County Health Rankings & Roadmaps, a Robert Wood Johnson Foundation and University of Wisconsin Population Health Institute joint program. To identify the least healthy cities, 24/7 Wall St. reviewed all U.S. metropolitan statistical areas. The index rankings are based on overall health outcomes, a weighted composite of length of life, quality of life, and overall health factors. The health factors component is itself a weighted composite of healthy behaviors, clinical care, social and economic factors, and physical environment measures. Data on life expectancy came from the Institute for Health Metrics and Evaluation, a global health research center affiliated with the University of Washington.

24/7 Wall St. is a USA TODAY content partner offering financial news and commentary. Its content is produced independently of USA TODAY.