In a paper published Friday in the BMJ, formerly known as the British Medical Journal, American researchers tracked more than 4,700 people in Framingham, Massachussetts, as part of a heart study from 1983 to 2003.
When they analyzed the data looking for happiness trends, the scientists found that happy people passed on their cheer to people they didn't personally know - and this transferred happiness lasted for up to a year.
"Happiness is like a stampede," said Nicholas Christakis, a professor in Harvard University's sociology department, one of the study's authors. "Whether you're happy depends not just on your own actions and behaviors and thoughts, but on those of people you don't even know."
Christakis and James Fowler, an associate professor of political science at the University of California in San Diego, previously found that obesity and smoking habits spread socially as well.
For this study, they examined questionnaires that asked people to measure their happiness and found distinct happy and unhappy clusters that were significantly bigger than would be expected by chance alone.
Happiness lasted for up to three cycles: to the friends of friends of friends.
Happy people tended to be at the center of social networks and had many friends who were also happy. Having friends or siblings live nearby increased peoples' chances of being upbeat.
Happy spouses helped too, but not as much as happy friends of the same gender. No effects were seen with coworkers.
Christakis and Fowler estimate that each happy friend boosts your own happiness chances by 9 percent. Having grumpy friends decreases it by about 7 percent.
Being happy also brings other benefits.
"Happiness has a protective effect on your immune system and you produce fewer stress hormones," said Andrew Steptoe, a professor of psychology at University College London who was not linked to the study.
Other experts said people shouldn't assume they can make themselves happy just by making the right friends.
"The psychological health of your friends is a predictor of your own mental health, but to say you can manipulate who your friends are to make yourself happier would be going too far," said Stanley Wasserman, an Indiana University statistician who studies social networks.
Because the study was done in a single community, further research is needed to confirm its findings. The study was also conducted before the rise of online social networking sites like Facebook and MySpace.
"This type of technology enhances your contact with friends, so it should support the kind of emotional contagion we observed," Christakis said, though he couldn't say if being on Facebook would make you happier.
Fowler said the study was the first tentative evidence of karma.
"The fact that happiness spreads from person to person to person suggests that these waves of happiness we radiate could eventually wash up on our own shores," he said.