Sports fans may experience a boost to their self-esteem when their team wins, a new study suggests.

Researchers at Ohio State University and the University of Alabama — schools where people know about football madness — found that when their university’s football team was victorious, fans experienced a two-day lift in how they felt about themselves.

The study appeared this week in the journal Communication and Sport.

The researchers found the key for fans of both the winning and losing teams was whether they watched the game with friends. Following a defeat, fans’ self-esteem didn’t suffer if they were able to commiserate with other fans, the study found.

“Just feeling connected to others while watching the game helped sustain self-esteem,” said Silvia Knobloch-Westerwick, co-author of the study and a professor of communication at Ohio State.

Right before a 2015 match-up between Michigan State University and Ohio State, researchers questioned 174 students from both schools about their self-esteem, mood, appearance, academic ability, and other issues. They told the students the study was about “well-being and leisure activities” so they wouldn’t suspect the real reason. They then questioned the students the day after the game and again a day later.

Ninth-ranked Michigan State defeated third-ranked Ohio State, 17-14, by a field goal as time expired, handing the Buckeyes their first loss of the season.

Following the game, which occurred on a Saturday, researchers found that Michigan State students had significantly higher levels of self-esteem, which continued to increase on Monday, especially for those who watched the game with friends.

Michigan State fans who watched the game alone still had a bit of a self-esteem boost on Monday but not as much as the fans who watched with a group. Surprisingly, students who fared the worst were those who didn’t watch at all.

“People who didn’t watch couldn’t participate in the conversations, which probably led to a loss of self-esteem,” said Knobloch-Westerwick. “Winning or losing, it is better to be a fan with your friends."

The findings ring true for 76ers fan Pat Williams, 23, of Upper Darby, who tries to watch most of the NBA season’s 82 games. He watches about one-third with friends and the others by himself.

Williams said he feels a lift when watching a winning game with friends, who help feed his positive feelings. There is more adrenaline in the room, he said.

“You just keep talking about it and getting more excited,” Williams said. “It’s a boost when you are around other people, for sure.”

When the Sixers lose, he said, he always feels a bit better when he is with friends. He said the conversation quickly shifts to other sports or events and helps “shake off” any negative feelings.

“If you are with other people, you just move on,” Williams said.