A new nationwide study of obituaries has found that people with religious affiliations lived nearly four years longer than those with no ties to religion.

That four-year boost – found in an analysis of more than 1,000 obits from around the country – was calculated after taking into account the sex and marital status of those who died, two factors that have strong effects on lifespan.

The boost was slightly larger (6.48 years) in a smaller study of obituaries published in a Des Moines, Iowa, newspaper.

“Religious affiliation had nearly as strong an effect on longevity as gender does, which is a matter of years of life,” said Laura Wallace, lead author of the study and a doctoral student in psychology at The Ohio State University.

The study was published online today in the journal Social Psychological and Personality Science.

The researchers found that part of the reason for the boost in longevity came from the fact that many religiously affiliated people also volunteered and belonged to social organizations, which previous research has linked to living longer.

“The study provides persuasive evidence that there is a relationship between religious participation and how long a person lives,” said Baldwin Way, co-author of the study and associate professor of psychology at Ohio State.

In addition, the study showed how the effects of religion on longevity might depend in part on the personality and average religiosity of the cities where people live, Way said.

The first study involved 505 obituaries published in the Des Moines Register in January and February 2012. In addition to noting the age and any religious affiliation of those who died, the researchers also documented sex, marital status and the number of social and volunteer activities listed.

Results showed that those whose obit listed a religious affiliation lived 9.45 years longer than those who didn’t. The gap shrunk to 6.48 years after gender and marital status were taken into account.

The second study included 1,096 obituaries from 42 major cities in the United States published on newspaper websites between August 2010 and August 2011.

In this study, people whose obits mentioned a religious affiliation lived an average of 5.64 years longer than those whose obits did not, which shrunk to 3.82 years after gender and marital status were considered.

Many studies have shown that people who volunteer and participate in social groups tend to live longer than others. So the researchers combined data from both studies to see if the volunteer and social opportunities that religious groups offer might explain the longevity boost.

Results showed that this was only part of the reason why religious people lived longer.

“We found that volunteerism and involvement in social organizations only accounted for a little less than one year of the longevity boost that religious affiliation provided,” Wallace said. “There’s still a lot of the benefit of religious affiliation that this can’t explain.”

So what else explains how religion helps people live longer? It may be related to the rules and norms of many religions that restrict unhealthy practices such as alcohol and drug use and having sex with many partners, Way said.

In addition, “many religions promote stress-reducing practices that may improve health, such as gratitude, prayer or meditation,” he said.

The fact that the researchers had data from many cities also allowed them to investigate whether the level of religiosity in a city and a city’s “personality” could affect how religious affiliation influenced longevity.

The findings showed that a key personality element related to longevity in each city was the importance placed on conformity to community values and norms.

In highly religious cities where conformity was important, religious people tended to live longer than non-religious people.

But in some cities there is a spillover effect.

“The positive health effects of religion spill over to the non-religious in some specific situations,” Wallace said. “The spillover effect only occurs in highly religious cities that aren’t too concerned about everyone conforming to the same norms. In those areas, non-religious people tend to live as long as do religious people.”

Way said there are limitations to the study, including the fact that it could not control for important factors related to longevity such as race and health behaviors. But a potential strength was that, unlike other studies, religious affiliation was not self-reported, but was reported by the obituary writer.

Overall, the study provided additional support to the growing number of studies showing that religion does have a positive effect on health, Wallace said.

Other authors on the study were Rebecca Anthony, who is in her final year of medical school at Ohio State, and Christian End, associate professor of psychology at Xavier University.

The study was supported by grants from the National Science Foundation and the National Institutes of Health.