Feeling unhappy and cranky? The treatment: take a walk under some trees in the park.

That may not be the exact prescription of your doctor, but a first-of-its-kind study shows that visitors to urban parks use happier words and express less negativity on Twitter than they did before their visit—and that their elevated mood lasts, like a glow, for up to four hours afterwards.

The effect is so strong—a team of scientists from the University of Vermont discovered—that the increase in happiness from a visit to an outpost of urban nature is equivalent to the mood spike on Christmas, by far the happiest day each year on Twitter.

With more people living in cities, and growing rates of mood disorders, this research may have powerful implications for public health and urban planning.

The new study was published August 20 in People and Nature, an open-access journal of the British Ecological Society.

Green matters

For three months, a team of scientists from the University of Vermont studied hundreds of tweets per day that people posted from 160 parks in San Francisco. “We found that, yes, across all the tweets, people are happier in parks,” says Aaron Schwartz, a UVM graduate student who led the new research, “but the effect was stronger in large regional parks with extensive tree cover and vegetation.” Smaller neighborhood parks showed a smaller spike in positive mood and mostly-paved civic plazas and squares showed the least mood elevation.

In other words, it’s not just getting out of work or being outside that brings a positive boost: the study shows that greener areas with more vegetation have the biggest impact. It’s notable that one of the words that shows the biggest uptick in use in tweets from parks is “flowers.”

“In cities, big green spaces are very important for people’s sense of well-being,” says Schwartz; meaning that efforts to protect and expand urban natural areas extend far beyond luxury and second-tier concerns—“we’re seeing more and more evidence that it’s central to promoting mental health,” says Taylor Ricketts, a co-author on the new study and director of the Gund Institute for Environment at UVM.

In recent years, “a big focus in conservation has been on monetary benefits—like: how many dollars of flood damage did we avoid by restoring a wetland?” Ricketts says. “But this study is part of a new wave of research that expands beyond monetary benefits to quantify the direct health benefits of nature. What’s even more innovative here is our focus on mental health benefits —which have been really underappreciated and understudied.”

Measuring happiness

The new study relied on the hedonometer. This online instrument—invented by a team of scientists at UVM and The MITRE Corporation, including Chris Danforth and Peter Dodds, professors at UVM’s Complex Systems Center and co-authors on the new study—has been gathering and analyzing billions of tweets for more than a decade, resulting in numerous scientific papers and extensive global media coverage. The instrument uses a body of about 10,000 common words that have been scored by a large pool of volunteers for what the scientists call their “psychological valence,” a kind of measure of each word’s emotional temperature.

The volunteers ranked words they perceived as the happiest near the top of a 1-9 scale; sad words near the bottom. Averaging the volunteers’ responses, each word received a score: “happy” itself ranked 8.30, “hahaha” 7.94, and “parks” 7.14. Truly neutral words, “and” and “the” scored 5.22 and 4.98. At the bottom, “trapped” 3.08, “crash” 2.60, and “jail” 1.76. “Flowers” scored a pleasant 7.56.

Using these scores, the team collects some fifty million tweets from around the world each day—“then we basically toss all the words into a huge bucket,” says Dodds—and calculate the bucket’s average happiness score.

Park position

To make the new study, the UVM team fished tweets out of this huge stream—from 4,688 users who publically identify their location—that were geotagged with latitude and longitude in the city of San Francisco. This allowed the team to know which tweets were coming from which parks. “Then, working with the U.S. Forest Service, we developed some new techniques for mapping vegetation of urban areas—at a very detailed resolution, about a thousand times more detailed than existing methods,” says Jarlath O'Neil-Dunne, director of UVM’s Spatial Analysis Laboratory in the UVM Rubenstein School of Environment and Natural Resources and a co-author on the new study. “That’s what really enabled us to get an accurate understanding of how the greenness and vegetation of these urban areas relates to people’s sentiment there.”

“This is the first study that uses Twitter to examine how user sentiment changes before, during, and after visits to different types of parks,” says Schwartz, a doctoral student in the Rubenstein School and Gund Institute graduate fellow supported by the National Science Foundation. “The greener parks show a bigger boost.”

Overall, the tweets posted from these urban parks in San Francisco were happier by a dramatic 0.23 points on the hedonometer scale over the baseline. “This increase in sentiment is equivalent to that of Christmas Day for Twitter as a whole in the same year,” the scientists write.

The cause of affect

“Being in nature offers restorative benefits on dimensions not available for purchase in a store, or downloadable on a screen,” says UVM’s Chris Danforth, a professor of mathematics and fellow in the Gund Institute. He notes that a growing body of research shows an association between time in nature and improved mood, “but the specific causal links are hard to nail down.”

The team of UVM scientists consider several possible mechanisms through which urban nature may improve mental health, including Green Mind Theory that suggests that the negativity bias of the brain, “which may have been evolutionarily advantageous—is constantly activated by the stressors of modern life,” the team writes.

“While we don’t address causality in our study, we do find that negative language—like ‘not,’ ‘no,’ ‘don’t,’ ‘can’t,’—decreased in the period immediately after visits to urban parks,” says Danforth, “offering specific linguistic markers of the mood boost available outside.” Conversely, the study shows that the use of first-person pronouns—“I” and “me”—drops off dramatically in parks, perhaps indicating “a shift from individual to collective mental frame,” the scientists write.

Of course, Twitter users are not a representative sample of all people—just who are the “twitter-afflicted” (as Adam Gopnik wrote in a recent issue of the New Yorker) who pick up their phone to tweet from a park? Still, Twitter users are a broad demographic, earlier research shows, and this approach to near-real-time remote sensing via Twitter posts—not based on self-reporting—gives a new window for scientists onto the shifting moods of very large groups.

The nature of happiness has been pondered by philosophers for centuries and studied by psychologists for decades, but this new study suggests it might be as clear as that: in nature, people tend to be more happy—and that’s a finding “that may help public health officials and governments make plans and investments,” says UVM’s Aaron Schwartz.