Source: iko/Shutterstock

Your social environment has a big effect on your mood. In good times, you like to share the positive moments with others. In bad times, you reach out to other people and ask that they console you.

One way being around other people affects our well-being is through contagion. When you spend time with happy people, they focus on the positive, engage in upbeat activities, and share their . When you spend time with unhappy people, they often complain and find negative things to discuss. They away from fun activities, and their low energy often brings down the people around them.

A second way that other people can affect your well-being is through social comparison. If you are around people who are in some way worse off than you, that tends to make you feel good by comparison. If you are around people who are better off than you, that makes you feel bad by comparison. Spending time with friends who have much better jobs can be demoralizing, while being with friends whose jobs are not as good as yours can boost your .

Does your current level of happiness affect the kinds of people you want to be with? This question was explored in a paper by Jinhung Kim, Emily Kong, Incheol Choi, and Joshua Hicks, published in the March 2016 issue of Personality and Social Psychology Bulletin.

The researchers created scenarios in which Korean and American college students imagined that they had just taken a difficult exam and received a mediocre grade—a C. Some participants evaluated how this would make them feel, and whether they would want to spend time with a friend who was generally a happy person (which ought to make them feel good), but who had done well on the exam (which ought to make them feel bad). Other participants evaluated how they would feel and whether they would want to spend time with a friend who was generally an unhappy person (which ought to make them feel bad), but who had done poorly on the exam (which ought to make them feel good). After these ratings, participants rated their own level of happiness.

This experiment's design pitted the friend’s happiness against the friend’s test performance. The question is whether participants’ level of happiness affected their desire to find a companion who was in a positive mood or a companion who could provide a positive social comparison.

Across several studies, happy and sad people acted differently: Happy people predicted they would be happier and wanted to hang out with the student who was a happy person, even though that student had gotten a better score. Unhappy people did not have a strong preference for either the happy person or the person who had done poorly on the exam.

One study ruled out the possibility that unhappy people just wanted to be around unhappy people: When unhappy participants had a choice between a happy person who did worse on the exam (who provides a boost based on the happiness and social comparison dimensions) and an unhappy person who did better on the exam (who would decrease mood on both dimensions), they chose to be around the happy person.

The findings suggest that when you are happy, you tend to surround yourself with other happy people. Your positive mood presumably insulates you from the potentially negative effects of social comparison, and you focus on enjoying the company of happy friends.

It is less clear what is going on with the unhappy people in this study. It could be that some people seek the contagion of happy people, while others want a boost from social comparison. It is also possible that they are less certain that hanging around with other people will make them happier. It would be interesting to see further studies on this topic.

In many ways, it is better to focus on spending time with others who engage in positive activities. Those individuals help to create happy memories that boost your mood in the long term. Social comparison is a dangerous game to play, because it is always possible to find people who are more successful than you are—and that always provides fuel for a negative mood.