If you think of retirement as sitting on a beach sipping a cold beer, South Dakota likely doesn't come to mind. So it might be a surprise to learn that this sparsely populated state tops the list of best states to retire.

A recent ranking by Bankrate looked at seven relevant features in the life of a retiree and used government and expert sources to compare states against one another. They then weighed those rankings based on the importance given to them by responses to a survey, which found that 47% of Americans would consider moving when they retire.

The study examined seven categories, starting with cost of living and taxes -- both weighted 20%. Healthcare quality was weighted 15%, weather 15%, crime 10%, cultural vitality 10% and well-being 10%.

Based on Bankrate's ranking, these are the best states to retire: