A University of Maryland professor’s study found a correlation between the health of people in counties across the nation and tweets about happiness, food choices and physical activity from those areas.

Using those tweets from about 3,000 counties, principal investigator Quynh Nguyen found a relationship between them and lower rates of premature mortality and obesity, as well as higher rates of physical activity.

Obesity prevalence was 2.23 percent to 2.49 percent lower in counties with the highest percentages of tweets about happy or healthy subjects, according to the study, and there were 714 fewer premature deaths per 100,000 people.

[Read more: 15 percent of UMD students face food insecurity, study shows]

Social media is now becoming a key source of data for researchers, said Nguyen, also a professor in this university’s public health school.

“Social media is a way to tap into and characterize the social environment of places and to do it in a cost-effective way because it is publicly available and pervasive and there are large quantities of it,” Nguyen said. The rise of social media helps researchers find consistent information outside of Census data and get more context behind it, Nguyen added.

Social media represents a new type of real-time data that can allow public health officials to examine movement of norms, sentiment and behaviors that may highlight emerging issues or outbreaks, providing a way to address health issues and measure the success of intervention, according to the study.

Several university students said they think tweets are a good gauge for an individual’s thoughts, and therefore health.

[Read more: UMD scientists are trying to figure out why dorms are so contagious]

It’s easier to indicate feelings on a platform like Twitter because it’s online and there is no real face-to-face discussion, said Tiffany Poetranto, a senior public health science major.

“Sometimes people tend to be more vocal behind a screen. It’s less likely for someone to judge them on Twitter or what they are feeling,” Poetranto said.

Freshman Jessica Shaker, who is enrolled in letters and sciences, agreed with Poetranto that students will more easily admit how they are doing mentally on Twitter.

“I think you can get a lot of signs from Twitter about how students are feeling,” Shaker said. “A lot of people go to Twitter as an outlet, because they feel like they can’t say what they are feeling to another person.”

Tweets coming from Prince George’s County are less happy and healthful than the national average.

About 14.8 percent of tweets in the county are happy, compared to an average of 18.5 percent in the nation, according to the study. People in Prince George’s County also tweet less about physical activity — 1.2 percent as opposed to 2.1 percent nationwide, according to the study.

The county’s obesity rate is 33.8 percent, according to the Open Data Network, whereas the average county in the study had an obesity rate of 31 percent.

Tweets are categorized as “happy” by using a software called Machine Learning for Language Toolkit to detect the sentiment of tweets. The software used tweets a research team had labeled to learn what a human considers a “happy” or “unhappy” tweet, Nguyen said.

“Counties or areas with higher happiness or more food tweets or physical activity tweets have higher health and lower mortality,” Nguyen said.