For the study, published in the journal Sleep Science and Practice, 832 participants over age 60 (the average age was 79) were asked to fill out a 10-question survey on their purpose in life, and a 32-question survey on sleep. More than half of the study participants were African American, and 77 percent were women.

Those who felt they had a strong purpose in life were 63 percent less likely to to have sleep apnea, 52 percent less likely to suffer from restless leg syndrome, and most of them had better sleep quality overall.

"Helping people cultivate a purpose in life could be an effective drug-free strategy to improve sleep quality, particularly for a population that is facing more insomnia," said senior study author Jason Ong, associate professor of neurology at Northwestern University Feinberg School of Medicine. "Purpose in life is something that can be cultivated and enhanced through mindfulness therapies."

While this survey was only conducted on older adults—who typically have a harder time sleeping than younger people—it has implications for the larger population as well. And while "cultivating a life purpose" may seem like a vague mission, participants were asked to rate how strongly they felt good about what they had done in the past, and what they hoped to do in the future. In other words, if you have a pet you feel good about taking care of, that could be enough of a "life purpose"—you don't have to work hard to save the world on a daily basis to sleep better.