After surviving a heart attack or severe blockage of blood flow to the heart, optimistic people are more likely to make healthy lifestyle changes and less likely to end up back in the hospital, a U.S. study suggests.

Optimism was linked to an 8 percent lower risk of repeat hospitalizations in the six months after one of these serious events, known as acute coronary syndromes (ACS). A positive outlook was also associated with being more active on a typical day.

Gratitude, however, didn’t appear to make a meaningful difference in these outcomes during this crucial six-month period after ACS.

“It can be a very vulnerable period – rates of rehospitalizations and death are high in the months following such an event, so it is really important to understand what factors may predict better outcomes,” said lead study author Dr. Jeff Huffman, a researcher in cardiac psychiatry at Massachusetts General Hospital and Harvard Medical School in Boston.

“Having an acute coronary syndrome can be kind of a watershed moment: people can thrive after the event and make substantial changes in the way they live their lives – being more active, following a healthier diet, quitting smoking – or they can end up feeling discouraged or demoralized, and not making changes.”

To see what might nudge people toward the path of change, Huffman and colleagues analyzed data on 164 patients hospitalized for acute coronary syndromes between 2012 and 2014.

The patients were 62 years old, on average, and most were white and male. For more than half, this was their first acute coronary syndrome.

Two weeks after hospitalization, researchers used a questionnaire to measure optimism and gratitude, and also asked patients to recall how active they typically were on days before they landed in the hospital.

Then, six months later, they assessed how many times patients returned to the hospital and how many steps per day patients logged on activity trackers. They also did blood tests to look for signs of inflammation, which can indicate a future risk of repeat heart episodes.

During the six-month study, 35 patients, or 21 percent, were readmitted to the hospital and 28 people returned for emergency heart problems. The optimists in the study were 8 percent less likely to return to the hospital for cardiac issues, and 6 percent less likely to go back for any reason.

Participants took an average of about 5,150 steps a day, or roughly 2.5 miles, though their habits varied widely and again, optimists outperformed their less cheery peers.

But when researchers did lab tests to check for proteins in the blood that can point to inflammation, a risk factor for acute coronary syndromes, optimism didn’t appear to make a difference.

Shortcomings of the study include its focus on patients at one academic medical center as well as the preponderance of white men, which may limit how relevant the findings are to other patients in other places, the authors acknowledge in the journal Circulation: Cardiovascular Quality and Outcomes.

Even so, the findings add to an already robust body of evidence suggesting that psychological factors can have a big influence on outcomes for people who suffer a heart attack or unstable angina, noted Andrew Steptoe, a public health researcher at the University College London who wasn’t involved in the study.

“The situation of people suffering an acute cardiac event is different from that of people undergoing surgery: surgery is usually planned so the patient can prepare for it, whereas cardiac events often come out of the blue,” Steptoe said by email. “But in both cases, a positive orientation is an asset.”