12. Oregon | Cost of living: 37 | Crime: 27 | Culture: 22| Health care quality: 42 | Taxes: 10 | Weather: 35 | Well-being: 35 (Photo: AP)

11. Oklahoma | Cost of living: 7 | Crime: 41 | Culture: 44 | Health care quality: 47 | Taxes: 32 | Weather: 10 | Well-being: 46 (Photo: AP)

10. South Carolina | Cost of living: 23 | Crime: 46 | Culture: 41 | Health care quality: 27 | Taxes: 37 | Weather: 8 | Well-being: 37

9. Nevada | Cost of living: 33 | Crime: 38 | Culture: 32 | Health care quality: 47 | Taxes: 5 | Weather: 27 | Well-being: 43

8. Washington | Cost of living: 38 | Crime: 37 | Culture: 29 | Health care quality: 34 | Taxes: 17 | Weather: 36 | Well-being: 22 (Photo: AP)

7. Illinois | Cost of living: 36 | Crime: 25 | Culture: 35 | Health care quality: 30 | Taxes: 29 | Weather: 23 | Well-being: 36 (Photo: AP)

6. California | Cost of living: 49 | Crime: 32 | Culture: 20 | Health care quality: 19 | Taxes: 48 | Weather: 14 | Well-being: 14

5. Arkansas | Cost of living: 2| Crime: 47 | Culture: 50 | Health care quality: 50 | Taxes: 39 | Weather: 9 | Well-being: 48 (Photo: AP)

4. Louisiana | Cost of living: 16 | Crime: 48 | Culture: 45 | Health care quality: 44 | Taxes: 42 | Weather: 3 | Well-being: 49

3. Maryland | Cost of living: 47 | Crime: 33 | Culture: 21 | Health care quality: 24 | Taxes: 43 | Weather: 20 | Well-being: 30

2. New Mexico | Cost of living: 22 | Crime: 50 | Culture: 37 | Health care quality: 49 | Taxes: 34 | Weather: 21 | Well-being: 26

1. New York | Cost of living: 50 | Crime: 13 | Culture: 13 | Health care quality: 41 | Taxes: 49 | Weather: 39 | Well-being: 23

(Related: 12 Best States for Retirement: 2018)

A state’s taxes and cost of living are the most important factors in people’s decision where to retire, according to a new ranking by Bankrate.com.

The least desirable states for retirement generally had low ratings in these categories and tended to be weighed down by low scores in other categories.

Bankrate.com constructed its rankings by examining seven categories of interest to retirees and weighted those rankings based on the importance given to them by respondents to the firm’s 2017 survey: cost of living (20%), taxes (20%), health care quality (15%), weather (15%), crime (10%), cultural vitality (10%) and well-being (10%).

Well-being encompassed how people felt about their community, friends, health and general purpose.

“It’s vital to have strong relationships with your friends and spouse and spend your money on leisure activities that bring you joy,” said Bankrate.com analyst Taylor Tepper, citing recent research.

Two states far down in the rankings were brought low on crime, well-being, health care and cultural quality even though they scored well on cost of living, while another state with good scores on cultural quality and crime did very poorly on cost of living and taxes.

Check out the gallery for the 12 worst states for retirement, according to Bankrate.

— Related on ThinkAdvisor: