The team used information on urban levels of ultrafine particulate matter -- PM 2.5 concentration -- from the daily air quality readings released by China's Ministry of Environmental Protection.
To measure daily happiness levels for each city, the team applied a Machine Learning (ML) algorithm to analyze the 210 million geotagged tweets from China's largest microblogging platform, Sina Weibo.
The tweets cover a period from March to November 2014.
For each tweet, the researchers applied the machine-trained sentiment analysis algorithm to measure the sentiment of the post.
They then calculated the median value for that city and day, the so-called expressed happiness index, ranging from 0 to 100, with 0 indicating a very negative mood, and 100 a very positive one.
Finally, the researchers merged this index with the daily PM2.5 concentration and weather data.
They found a significantly negative correlation between pollution and happiness levels.
"Women were more sensitive to higher pollution levels than men, as were those on higher incomes," revealed the report.
When the researchers looked at the type of cities that the tweets originated from, they found that people from the very cleanest and very dirtiest cities were the most severely affected by pollution levels.
"This may be because those people who are particularly concerned about their health and air quality tend to move to clean cities, while those in very dirty cities are more aware of the damage to their health from long-term exposure to pollutants," said Zheng.
A recent study by Chinese Hong Kong University found that air pollution in the country causes an average of 1.1 million premature deaths each year and costs its economy $38 billion.