McKinney, Texas, with its low cost of living and high median income, has been named the most affordable city in the United States, according to a new study.

The study, produced by The Motley Fool Ascent, compared median household income to cost-of-living data in hundreds of cities. Each city’s cost-of-living index was multiplied by median household expenditures nationwide to calculate a cost-of-living estimate. The city’s median household income was then divided by its cost-of-living estimate to calculate an estimated income-to-expense ratio. The higher the ratio, the more affordable the city.

McKinney’s estimated income-to-expense ratio was 1.60, based on a cost-of-living estimate of $70,778 and a median household income of $113,286.

“McKinney boasts a cost-of-living index three points below the national average, while residents earn a median income 52% higher than the national median,” says the study. “McKinney is an attractive location for mid-career Americans. The average age there is 37 and the median property value is $400,400, which is about $20,000 lower than the national median home sales price. The largest industries are professional, scientific and technical services, retail, and healthcare.”

Two other Texas cities finished in the top 10.

Midland ranked No.4 with an estimated income-to-expense ratio was 1.27, based on a cost-of-living estimate of $70,997 and a median household income of $90,448. “The cost of living [in Midland] is just below the national average, while the median household income is 21% above the national median,” says the study.

Austin ranked No.7 with an estimated income-to-expense ratio was 1.21, based on a cost-of-living estimate of $71,435 and a median household income of $86,556. “Its cost of living is 2% below the national average while the median household income there is 16% above the national median. The cost of housing in Austin is just 5% over the national average while all other major categories of cost of living are below the national average, according to The Council for Economic and Community Research,” says the study.

Decatur, Illinois, was named the cheapest city in the country. Three Texas cities also ranked among the cheapest to live in: Edinburg came in third, Harlingen came in sixth, and Amarillo came in eighth.

New York was named the most expensive city in the country. No city in Texas made the most expensive list.

The top 10 most affordable cities in the U.S., according to The Motley Fool Ascent, were:

  1. McKinney, Texas
  2. Edmond, Oklahoma
  3. Morristown, New Jersey
  4. Midland, Texas
  5. Joliet, Illinois
  6. Hilton Head Island, South Carolina
  7. Austin, Texas
  8. Pierre, South Dakota
  9. Surprise, Arizona
  10. Minot, North Dakota