After analyzing 1 billion anonymous status updates among more than 100 million Facebook users between 2009 and 2012, researchers report that feelings can be highly contagious in the virtual world.

“Online networks can spread emotions just like the real world,” said lead researcher James Fowler, professor of political science and medical genetics at the University of California, San Diego.

“For every one happy post you write, it causes friends in other cities to write an additional one or two happy posts,” he said. Every negative post spawns about one additional negative post among friends, the study found.

“I was surprised by the magnitude of the effect,” he said.

The findings were published online March 12 in the journal PLOS ONE.

Researchers have long known that emotions in the real world are contagious, Fowler noted. For instance, if you have a crabby co-worker, it may make you a little grouchy, too. “In the lab, we will just randomly expose some people to a happy person and some to a sad person, and we can see the emotions spread,” he said.

Less is known, however, about whether that same phenomenon happens in the online world.

To find out more, Fowler’s team used a software program to analyze the posts, measuring the emotional content of each one and classifying them as positive or negative.

The researchers tallied up the negative and positive posts from 100 different cities for three years. Then, they matched that with something none of the social media users had any control over — rainy days.

They found, predictably, that rainy days increased negative posts by 1.16 percent and reduced the number of positive posts by 1.19 percent.

Then they looked at how the negative posts from friends in rainy cities affected the posts of friends in sunny cities. If it’s rainy in New York, will your New York friend’s gloomy post affect you in sunny San Diego? Apparently yes, the researchers found. The negative posts spawned more of the same, and the happy posts spawned more happy posts.

Each additional negative post triggered 1.29 more negative posts among one’s friends, and each additional positive post produced an additional 1.75 positive posts among friends, Fowler’s team reported.

The gap between the “real” world and online world may be closing “faster than we thought,” Fowler said. Some of that closing may be due to more and more online features that simulate face-to-face contact, he suggested.

The computer program may miss some nuances, Fowler acknowledged. A negative word used in a humorous way, for instance, may be interpreted as a negative when the writer was just trying to be funny. Even so, Fowler said the sheer volume of posts analyzed compensates for that.

One expert said the phenomenon could be put to good use.

The findings add to the growing research field in which experts are trying to understand how emotions spread online, said Anatoliy Gruzd, director of the social media lab at Dalhousie University in Halifax, Nova Scotia, Canada.

In his own research, he has found that “Twitter users post more positive messages than negative, and that positive tweets are three times more likely to be forwarded than negative tweets.”

The research does more than help social media users decide which post they may read. It also has the potential to help improve health, both Gruzd and Fowler said, especially with the growing volume of health support websites. For instance, Gruzd said, those who participate in a happy online health support community might improve their well-being.

The research was partially supported by grants from the Army Research Office, the U.S. National Institute for General Medical Sciences and the Robert Wood Johnson Foundation.