The popular kids always seem to be the most confident, but that’s not always the case in reality, according to a new study. Instead, people who belong to a large number of groups or clubs reported higher levels of self-esteem than people who have a big network of friends.

In the study, Canadian Institute for Advanced Research fellows — including Nyla Branscombe of the University of Kansas, Alexander and Catherine Haslam of the University of Queensland, and Jolanda Jetten — analyzed how group membership improved people’s self-esteem. They examined groups of children, elderly, and formerly homeless people in the U.K., China, and Australia.

It turns out that no matter the person’s background, they showed higher levels of self-esteem if they belonged to one or multiple groups — but only if the groups were somehow connected to their social identity and sense of self. That’s in comparison to people who just had a lot of friends, but weren’t involved in any groups.

“Groups often have rich value and belief systems, and when we identify with groups, these can provide a lens through which we see the world,” Jetten, lead author of the study, said in the press release. Self-identifying with religious, cultural, ethnic, or even hobbies groups could help people have a sense of purpose, the authors argue.

The authors add that past research has shown that people involved in social groups experience better mental health and live healthier, longer lives than people who aren’t involved in groups. Indeed, past research has shown the loneliness leads to negative health effects, including a higher risk of earlier death, depression, and heart disease.

When it comes to self-esteem, it’s not always just about your own internal musings; confidence-building is often more linked to social connections than one might imagine. The authors of the study point out that when it comes to improving your self-esteem, perhaps reaching out to people and enhancing your social connections will have a greater effect on you than just introspection and individual growth.

“Rather than fetishizing self-esteem, a much better and probably healthier and more effective strategy is to encourage people to have rich social lives and multiple sources of social engagement,” Haslam said in the press release. “If you do that, one important by-product will be improved self-esteem, but there will be lots of other benefits too.”

Source: Jetten J, Branscombe N, Haslam A, Haslam C, Cruwys T, Jones J. Having a Lot of a Good Thing: Multiple Important Group Memberships as a Source of Self-Esteem. PLOS One, 2015.