Dogs can reportedly help you live longer.

Using nearly 70 years of global research, a new study from the American Heart Association published on Tuesday analyzed the health benefits of dogs from a sample of 4 million people in the U.S., Canada, Scandinavia, New Zealand, Australia, and the U.K., CNN reports.

“Our analysis found having a dog is actually protective against dying of any cause,” said Mount Sinai endocrinologist Dr. Caroline Kramer, lead author of the report. “Dog ownership was associated with a 24 percent reduction in all cause mortality.”

Having a dog was even more beneficial for people who already had a heart attack or stroke. “They had a 31 percent reduced risk of dying from cardiovascular disease,” she said. According to the World Health Organization, heart attacks and stroke are the leading cause of death globally.

Dog owners who live alone seem to benefit the most. Heart attack survivors who live alone and own dogs had a 33 percent lower risk of death compared to those who don’t own a dog. Stroke survivors living alone and with dogs had a 27 percent reduced risk of death.

“We know that loneliness and social isolation are strong risk factors for premature death and our hypothesis was that the company of a pet can alleviate that,” said study author Tove Fall, an associate professor of epidemiology at Uppsala University in Sweden. “Single owners have to do all the dog walks and we know that physical activity is important in rehabilitation after a myocardial infarction or stroke.”

However, the studies were only observational, which means researchers cannot prove that dog ownership caused increased life expectancy or bettered health outcomes after a heart attack or stroke.

Still, some cardiologists believe that dogs are so helpful that they will prescribe dogs for their patients.

“While these non-randomized studies cannot 'prove' that adopting or owning a dog directly leads to reduced mortality, these robust findings are certainly at least suggestive of this," said Dr. Glenn Levine, chair of the writing group of the American Heart Association's scientific statement on pet ownership.

Studies show that dogs decrease stress, promote relaxation, and affect all stages of our lives, per the Centers for Disease Control and Prevention.