But a new study published in Proceedings of the Royal Society B challenges that notion. Depression doesn’t spread, it found, but a healthy mood does. The researchers looked at data from more than 2,000 high-school students who took a survey of depression symptoms, and who also reported who their friends were, over a period of six to 12 months. Kids who initially scored as clinically depressed did not “infect” their friends, but if they had enough friends who had what the study called a “healthy mood” (in that they didn’t meet the criteria for depression), that doubled their chances of recovering from their depression. And for people who weren’t depressed in the first place, having enough mentally healthy friends halved their chances of developing depression.

That’s a pretty large effect, and supports previous research saying that high-quality social relationships lower people’s risk of depression.

Thomas House, one of the study authors and a senior lecturer in applied mathematics at the University of Manchester, says he believes this model has an advantage over the studies that find clusters. When you find clusters of friends who are depressed, it’s possible there’s a third factor at play—maybe “they're all heavily drinking or they’re all doing something else that makes them more predisposed to depression,” House says. “Our method wasn't susceptible to that because we looked at direct changes of state. We were pretty much directly observing this process of your friend influencing you. And the nice conclusion that we got was that your friends can protect you from depression and help you recover from it.”

That’s if mentally healthy people are there for their depressed friends, which could be easier said than done. Even if you can’t actually catch depression, that’s not to say spending time with a depressed friend doesn’t take its toll. As the cartoonist Allie Brosh, of the site Hyperbole and a Half, wrote in her astute comic about depression, “It's weird for people who still have feelings to be around depressed people. They try to help you have feelings again so things can go back to normal, and it's frustrating for them when that doesn't happen.”

“We’re not saying you have no negative effect on your friends’ mood but just that it’s not enough to push them into really full clinical depression,” House says.

And people suffering from depression may be inclined to withdraw anyway, to retreat and ruminate alone. That can be exacerbated by their friends’ misguided attempts to cheer them up.

“People want to help,” Brosh writes. “So they try harder to make you feel hopeful and positive about the situation … The positivity starts coming out in a spray—a giant, desperate happiness sprinkler pointed directly at your face. And it keeps going like that until you're having this weird argument where you're trying to convince the person that you are far too hopeless for hope just so they'll give up on their optimism crusade and let you go back to feeling bored and lonely by yourself.”