Happiness spreads within couples, the research found
Happiness is infectious and can "ripple" through social groups, according to US researchers.
A study of 5,000 adults suggests a person's happiness is dependent on the happiness of those around them.
A friend who becomes happy and lives less than a mile away increases your likelihood of happiness by 25%, the British Medical Journal reported.
But the mood of work colleagues did not have an effect, the Harvard Medical School-led study found.
The researchers used data on adults who took part in the US Framingham Heart Study - set up to look at the risks leading to future heart disease - between 1971 and 2003.
Participants were asked to identify their relatives, close friends, place of residence, and place of work and were followed up every two to four years.
They were also asked whether they agreed with statements on whether they enjoyed life, felt hopeful about the future, were happy and felt they were just as good as other people.
It was found that live-in partners who become happy increased the likelihood of their partner being happy by 8% and similar effects were found for siblings living close by (14%) and neighbours (34%).
The relationship between people's happiness levels seemed to extend up to three degrees of separation - to the friend of a friend of a friend.
The analysis also showed that close physical proximity was important for the spread of happiness.
A person was 42% more likely to be happy if a friend who lives less than half a mile away becomes happy - an effect that declined with greater distance.
Study leader Professor Nicholas Christakis said the results suggest clusters of happiness occur because happiness spreads and not just because of a tendency for people to associate with similar individuals.
"Most important from our perspective is the recognition that people are embedded in social networks and that the health and wellbeing of one person affects the health and wellbeing of others."
HAVE YOUR SAY
Trees and woodlands, and living near them tends to make me happy
James Shepherd, London
Professor Andrew Steptoe, a psychology expert from University College London, said: "It makes intuitive sense that if people around you are happy that might have an impact on your own happiness.
"What's a bit more surprising is that it's not just the people who you closely come into contact with but people a step removed as well."
He said the work had implications for public health.
"Happiness does seem to be associated with protective effects on health.
"If happiness is indeed transmitted through social connections, it could indirectly contribute to social transmission of health," he said.