It’s been well established for years that—especially for men—a stable marriage is linked to a number of general health benefits, including fewer heart attacks and strokes, better outcomes from cancer and a reduced risk of ending up in a nursing home.

Now, there’s another advantage to being hitched—marriage may lower one’s risk of developing dementia.

Recent finding: Married people (including those who are cohabitating and identify as married) have a lower risk of developing dementia than those who have never married and those who have outlived their spouses, according to a new analysis published in the Journal of Neurology, Neurosurgery & Psychiatry. Researchers crunched the data from 15 studies, which included more than 800,000 participants from Europe, North America, South America and Asia.

What did the numbers tell us?

Details: Compared with people who were married, those who had never tied the knot were 42% more likely to develop dementia…and people who were widowed were 20% more likely, even when age and sex were factored in.

No such associations were found among people who had divorced their partners, though the researchers point out that this could be due to the smaller numbers of divorced people in the studies.

No one knows for sure why marriage may help stave off dementia, but there are several possible reasons. For one thing, marriage may help each partner maintain a healthier lifestyle…by exercising more, eating a healthier diet and smoking and drinking less—all of which have been associated with a lower risk for dementia. Wedded couples also may have more opportunities to socialize than single people—a factor that has also been linked to better health and lower dementia risk.

On the flip side, lifelong singletons may have a higher risk for dementia due to poorer overall physical health, since they are missing out on the chance to create a healthy lifestyle with a partner. For widowed people, the higher risk could be caused, in part, by the stress that comes with bereavement. Higher stress levels have been associated with impaired nerve signaling and cognitive abilities.

Caveats: The recent findings on marriage and dementia are based on observational studies, so there’s no way to prove cause and effect. It’s also worth noting that the studies did not include any information on the happiness of the marriages or the duration of the study participants’ widowhood.

Bottom line: No one should count on marriage to prevent dementia, but understanding the ways that a partnership can help ward off cognitive decline may help you modify your risk factors.

And if you don’t have a partner? Live as though you do! Make a commitment to yourself to eat better, get more exercise and stop smoking and any other unhealthy habits. If you lack social support at home, find other ways to socialize—join a book club (there’s evidence that interesting and challenging conversation also may help ward off dementia)…visit a museum and take a group tour…or take regular walks with friends.

If you need more friends, there are plenty of helpful options. For example, you can locate other people who are interested in the same activities you are (such as hiking, meditation or learning a language) by using a website such as Meetup. In addition to eating right and getting regular exercise, engaging in healthy social activities that reduce stress seems to be a key component in lessening your risk for dementia.