When you’re thinking of retirement, a rural oasis may be at the top of your list of places to live. But a new study shows why you may want to stick to city life.

Researchers from the Massachusetts Institute of Technology and Stanford University analyzed Medicare data that compared older adults who moved long distances. Results showed that longevity is affected by where they chose to live.

Metro areas were put into the 10th or 90th percentile based on how they enhance longevity. Findings revealed that when 65-year-olds move from a metro area in the 10th percentile to one in the 90th percentile, their life expectancy grew by 1.1 years. The average U.S. life expectancy for 65-year-olds is is 83.3 years.

The study was published in the American Economic Review, a peer-reviewed journal.

“There’s a substantively important causal effect of where you live as an elderly adult on mortality and life expectancy across the United States,” study co-author Amy Finkelstein, professor in MIT’s Department of Economics, said in a news release.

Researchers analyzed Medicare records from 1999 to 2014 for the study. They focused on 6.3 million Medicare beneficiaries between the ages of 65 and 99. Around 2 million people moved from one U.S. “commuting zone” to another. The other estimated 4.3 million were a random 10% sample of people who didn’t move during the 15-year period.

A crucial study aspect was looking at how different people from the same locations progressed when they moved to different places.

“The idea is to take two elderly people from a given origin, say, Boston. One moves to low-mortality Minneapolis, one moves to high-mortality Houston. We then compare how long each lives after they move,” Finkelstein said.

Although people have varying health profiles, the study’s Medicare records had detailed claims data. Using that, researchers used records of 27 different illnesses and conditions to categorize older adults’ general health. Conditions included diabetes, lung cancer and depression. Researchers also tried to account for pre-existing health levels of people from the same location who moved to different places.

Additionally, researchers estimated what fraction of people’s health conditions they didn’t see. They also reviewed how health varies among people from the same location who move to different places. Estimates were adjusted for differences in unobserved and observed health.

Ultimately, the study showed cities on the East and West Coasts — including New York City, San Francisco and Miami — positively affect longevity. Positive outcomes were found for some Midwestern metro areas, too, such as Chicago. In much of the deep South, however, longevity was poorly affected. This included the majority of Alabama, Arkansas, Louisiana and northern Florida. The bulk of the Southwest had a similar outcome. That included portions of Texas, Oklahoma, New Mexico and Arizona.

Researchers welcome more studies to see why different places have different effects on longevity.

“Differences in health care across places are large and potentially important,” Finkelstein said. “But there are also differences in pollution, weather, (and) other aspects. What we need to do now is get inside the black box of ‘the place’ and figure out what it is about them that matters for longevity.”

For more on the study, see the complete news release here.

To get specialized news and articles about aging in place, health information and more, sign up for our Aging in Atlanta newsletter.