Where can people expect to live the longest?

The answer to that question is usually pretty predictable and often dependent on wealth: People generally live longer in richer countries. Like Japan and Switzerland, where average life expectancies exceed 83 years.

In lower income countries, expected years of life are often far shorter — hovering below 55 in a number of sub-Saharan countries, including Chad, Mozambique and Sierra Leone.

But a recent data-crunch turned up a few surprises about how long people can expect to live in certain places, with some particularly encouraging news coming out of Niger.

The West African nation is on the low end of the life expectancy curve: 62 years on average.

Yet according to a new study, the country tops a list of how many years people can expect to live beyond what the country's level of development would predict. Nicaragua is also up there.

So what's the story in Niger?

It starts with early childhood. In 1990, more than one in four children born in the West African country died by age 5.

To keep its little kids alive, the government has set ambitious goals, including a policy instituted in 2006 that offers free health care to women and children. There's also a national program to train more community health workers. As a result, more children are vaccinated for diseases and treated for major childhood killers like diarrhea.

Those steps have made a big difference. By 2012, deaths among young children had fallen to about 13 percent — which probably also explains why people in Niger can now expect to live longer than they used to, says Christopher Murray, a health economist at the University of Washington's Institute for Health Metrics and Evaluation in Seattle and lead author of the new study.

Niger isn't just doing better than expected. It's also making some of the biggest gains. In the data from 195 countries and territories, Niger came out at the top of a list of places where the gap between expected and measured life expectancies has increased the most over the last few decades.

It's truly an accomplishment. In 1980, people born in Niger could only expect to live to age 39, nearly five years younger than should be expected based on a country at its stage of development. In 2016, life expectancy in Niger was about eight years longer than would be predicted for a country of its wealth.

By analyzing what's happening in Niger and other countries that are making gains in life expectancy, researchers hope to zero in on the kinds of policies that might help extend lives everywhere, Murray says. Countries at the bottom of the list can serve as cautionary tales.

The hope is to "learn lessons from the places where there's success and from places where, even though we thought we were doing the right thing, are not doing as well as expected," he says.

The well-established link between wealth and life expectancy has fueled a search for outliers that do better or worse than expected based on a country's GDP per person, says Richard Feachem, director of the Global Health Group at the University of California, San Francisco, who was not involved with the new study.

But it's not just money that influences mortality. People also live longer when they have fewer children and when they get more education. To account for those three well-known trends and see what other factors might be influencing life and death, the new study scrapped GDP in favor of a measure called the Sociodemographic Index (SDI), which allowed them to control for wealth as well as fertility and education.

The study was part of the long-term Global Burden of Disease study, an international effort by more than 2,300 researchers to compile data on causes and rates of death around the world.

And that data has yielded a variety of surprises. Low- and middle-income countries that boasted longer lives than their SDI would predict, according to the new study, included Nicaragua, Gambia, Nepal, Ethiopia and Peru.

Ethiopia and Peru were also on the list of countries that have most improved their life expectancies in comparison to SDI predictions, along with the Maldives, Niger and Portugal. The researchers were particularly interested in this most-improved list, because its countries stand to offer the biggest insights which interventions might make a difference. By contrast, countries like Costa Rica that have boasted longer-than-expected life spans for a long time could simply be explained by healthy diets or lifestyles.

On the flip side, people in Greenland, Indonesia and Russia and in parts of the U.S. like Mississippi are among those failing to live as long as they should be.

The study didn't address the reasons for each story of success or struggle. But Murray has some theories: Ethiopia has made major gains in delivering health care to people in remote and rural areas. Peru has put a lot of work into reducing malnutrition and stunting in children. And several African countries, including Botswana, Rwanda and Zimbabwe, have scaled up treatment programs for HIV/AIDS.

In countries that are underperforming, possible explanations include suicide, drug addiction and uncontrolled epidemics of HIV/AIDS.

"We have speculation on this, but there is a lot of further work to be done to start breaking down what the actual policies are" that have made a difference, Murray says. As common themes emerge, he says, opportunities will open up for countries to apply strategies that are working elsewhere.

In the meantime, the new data revealed other interesting patterns, Murray says, including differences in life expectancies between men and women. Women tend to live longer than men, and the study found that gap becomes bigger with increasing levels of development. But at the highest levels of development, the gap starts to close.

One theory why is that men and women live the most similar lives at the highest levels of development — working the same kinds of stressful jobs and sharing the same vices, like drinking and smoking.

Another important finding from the data offers a positive message, Feachem says: Overall, people are living a lot longer than they used to.

Since 1970, he says, worldwide life expectancy has increased by 14 years, from 58 to 72. And since 1990, the proportion of children who die before their fifth birthday has dropped form nine percent to four percent.

"If you search back through 200,000 years of human history and ask if there is another 40-year period in which we've seen a 14-year gain in life expectancy, the answer would be no," Feachem says. "These are extraordinarily rapid, comprehensive and widespread improvements in human health."

That makes Niger just one example of how improvements in health can extend lives.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.