Where you live has a huge impact on your health and happiness: Location dictates everything from your local weather to crime rates. Each year, the Gallup-Sharecare Well-Being Index interviews 160,000 U.S. adults about their lives, scoring different regions of the country on their residents' well-being and ranking the states based on the overall happiness of the people who live there. This year, according to USA Today, 24/7 Wall Street decided to add to that dataset by analyzing even more socioeconomic data from the U.S. Census Bureau, the FBI, and elsewhere, such as poverty rates, crime, social ties, and health across the U.S. The result is a more complete picture of how happy some states are, and how miserable others are.

Some of the rankings might surprise you. Both Dakotas made it into the top 10, with South Dakota taking the overall prize for the happiest state. In the survey, residents reported a high sense of purpose, saying they like what they do each day and have reached most of their goals in the last year. More than 80 percent of respondents said they like what they do daily, more than any other state. In other high-scoring states, residents report a strong sense of security, good public health, and strong social ties. (Low crime and unemployment rates help.)

Here are the 10 happiest states in the U.S., according to the rankings.

1. South Dakota
2. Vermont
3. Hawaii
4. Minnesota
5. North Dakota
6. Colorado
7. New Hampshire
8. Idaho
9. Utah
10. Montana

Meanwhile, economic concerns and high crime dominate the responses within the rankings of the most miserable states in the U.S. West Virginia, the least happy state on the list, is plagued by financial insecurity and poor health outcomes. In the survey, West Virginians had the lowest numbers of people who said they were in "near perfect" physical health, liked what they do every day, or have strong social ties. Other states in the top 10 list of least happy states include Louisiana and Arkansas, both of which have some of the highest rates of poverty and violent crime in the country. In Oklahoma, one out of five people who responded to the survey said they struggled to afford food, and in Kentucky, 23 percent of respondents said they have been depressed in their lifetime.

These are the 10 most miserable states, according to these calculations.

1. West Virginia
2. Louisiana
3. Arkansas
4. Mississippi
5. Oklahoma
6. Kentucky
7. Ohio
8. Nevada
9. Indiana
10. Rhode Island

Head to USA Today to see the full list.