Governments, individuals, and corporations spend an enormous amount of time and money to keep Americans healthy. Investments in anything from medical research, health care, insurance, nutritional programs, and exercise facilities is meant to improve residents’ health and well-being. Such investments are not uniform across the United States, and other factors, including environmental ones — such as socioeconomic factors, pollution, and geography — also play a role in the health of residents. How healthy Americans are often depends on where they live.

24/7 Wall St. reviewed county-level health rankings from County Health Rankings & Roadmaps, a Robert Wood Johnson Foundation and University of Wisconsin Population Health Institute joint program. The health of Americans varies tremendously not just between states, but within each state.

The report ranked each state’s counties based on the incidence of premature death and self-reported levels of health — that is, how long and how well residents live. Premature death rates, measured as the number of people who die before age 75 per 100,000 people annually, range from 382 per 100,000 people in Kingfisher County, Oklahoma, to 157 deaths per 100,000 in Teton County, Wyoming. These counties are each the healthiest in their respective states. By contrast, in McDowell, the least healthy county in West Virginia, there are 889 preventable deaths per 100,000 residents each year, nearly the highest of all counties.

The quality of life, measured by several self-reported levels of well-being, also varies considerably. Of all counties reviewed, residents of Brooks County, Texas, report nearly the lowest quality of life, with 40% reporting fair or poor health. This is in stark contrast with Douglas, Colorado, where just 7% of adults report such low levels of health.

22.  Michigan

> Healthiest county: Ottawa
> Pct. without health insurance: 11.0%
> Pct. food insecure: 11.0%
> Obesity rate: 25.7%
> 2014 unemployment rate: 4.7%

In Ottawa County, just 15.0% of adults smoke and 25.7% are obese, better than the statewide 17.7% smoking and 31.4% obesity rates. Despite similar access to exercise opportunities, adults in Ottawa County exercise more often than adults in Michigan as a whole. Just 19.4% of county residents are physically inactive compared to 22.8% statewide.

These healthy behaviors have likely led to the best health outcomes in the state. There are 224.0 premature deaths per 100,000 county residents, a lower premature mortality rate than the 356.5 deaths per 100,000 people statewide.

How long and how well people live are a consequence of health factors, which include behavioral indicators such as exercise habits, smoking rates, obesity, and alcohol consumption; and socioeconomic indicators such as violent crime rates, unemployment, teen birth rates, the ratio of residents to physicians, and child poverty rates. In an interview with 24/7 Wall St., Bridget Catlin, co-director of the County Health Rankings & Roadmaps program at the University of Wisconsin, explained that these are factors that community leaders and county residents can improve.

No single factor can explain health outcomes in an area, and the circumstances leading to healthy lifestyles are often extremely complicated. However, a few indicators stand out. High incomes and financial stability, for example, are very common in these healthy areas. The median household income is higher than the state income level in all but one of the 50 counties on this list.

“When you are struggling, trying to make ends meet, it’s difficult to focus on being sure that you have healthy food on the table,” Catlin said. Not only are wealthier families more able to meet these basic needs, but also medical care, exercise opportunities, and access to other products and services that support better health are often quite expensive.

Premature death rates are lower in suburban and urban areas, and in large cities in particular, preventable deaths have declined in recent years. Premature death rates in rural areas, by contrast, have increased over the past several years.

Health care services are also more concentrated in relatively urban areas. In 33 states, the ratio of primary care physicians to residents in the healthiest county is better than the national ratio of 1 primary care physician to every 1,320 Americans.

Catlin noted that access to health care is only one reason for the strong health outcomes in the healthiest counties. These counties also tend to have more job opportunities, and with larger tax bases, the funding for health and other institutions and services is often greater. In 48 of the 50 states, the unemployment rate in the healthiest county is lower than the national rate.

Residents of these healthy counties are also more likely to have health insurance, which not only helps provide medical care when needed, but also offers individuals peace of mind and preventive care. Nationwide, 17% of Americans under 65 years old do not have health insurance. This percentage is lower in all but nine of these counties.

To identify the healthiest county in every state, 24/7 Wall St. reviewed county-level data from County Health Rankings & Roadmaps, a Robert Wood Johnson Foundation and University of Wisconsin Population Health Institute joint program. Rankings are based on overall health outcomes — a weighted composite of length of life, quality of life, and maternal health — 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 were compiled from more than 20 different sources and is for the most recent year available. A total of 3,140 counties were considered.

Click here to see the healthiest county in every state.