Do you feel like you don’t hit the gym enough or aren’t as physically active as other people your age? If so, you might want to work on your mindset—even more than your exercise regimen.

As it turns out, simply having guilt and insecurity about your level of fitness can be bad your health. That’s the conclusion of a sweeping study from Stanford University of more than 60,000 adults in the U.S.

Researchers Octavia Zahrt and Alia Crum focused on one question in particular asked of participants: “Would you say that, compared with others your age, you are physically more active, less active, or equally active?”

The findings: Those who perceived themselves as “less active” than their friends tended to live shorter lives and the dip in longevity held true even if the person was getting a nice amount of exercise—relatively equal to their friends.

Mindset is the X factor

The study built on earlier research by Crum of a group of hotel room attendants that showed the health benefits people get out of everyday activities depends in part of their mindset—that is, whether or not they believe that they are physically active enough. “These women were getting lots of exercise, but when we asked them, they didn’t have the mindset that their work was good exercise,” Crum says.

Afterward Crum gave a presentation to some of the hotel staff, explaining that all their heavy lifting and walking was, in fact, healthy exercise. After a month, these folks showed improvements in blood pressure and body fat.

Those who perceived themselves as “less active” than their friends tended to live shorter lives.

Crum and Zahrt then teamed up for more research on exercise mindset.

Using data from three national survey, the most recent study assessed more than 61,000 American adults, looking at their physical activity, health and personal background and controlling for factors like physical activity, age, body mass, and chronic illness. The researchers then viewed death records from 21 years after the surveys were conducted.

Their conclusion: Individuals who believed they were less active than others were up to 71% more likely to die in the follow-up period than people who thought they were more active than their peers.

The power of positive thinking

Shockingly, this mortality risk applied to people who were roughly the same  in every way as their peers—including how much they actually exercised.

The researcher’s explanation: The placebo effect was at work. In other words, those who believed they were getting enough exercise wound up experiencing greater physiological benefits.

Crum explains: “The belief you’re getting a pain medication can activate endogenous opiates in the brain. Similarly, the underlying dread of not exercising enough is a powerful frame of mind that can harm health.”

“The underlying dread of not exercising enough is a powerful frame of mind that can harm health.”
Researcher Alia Crum

Adds Zahrt: “People who think they are less active can be discouraged by that perception, and they might stop exercising and become less active over time.”  And that subsequent drop in real exercise might have influenced some of the negative health outcomes, Zahrt theorizes—although she tried to control for similarities in exercise in her study.

So if you spend time comparing yourself to your over achieving gym friends, don’t. Instead, inspire yourself with a positive mindset.

This article is adapted from the best-selling Life Is Long: 50+ Ways to Live a Little Closer to Forever by longevity and wellness expert Karen Salmansohn.