People who live in unhappy communities stay depressed for about a quarter of the month, says a study.
The researchers found that suburban residents seem to be the happiest, compared to those who live in rural areas and inner cities.
"This is a real concern not just in the United States, but across the world," said Stephan Goetz, professor at Pennsylvania State University in the US.
"Poor mental health can result in considerable economic costs, including losses of billions of dollars to lower productivity," Goetz said.
Residents in the community with the poorest mental health on average reported they spent 8.3 days a month in a negative mood.
People in high mental health areas reported they were in poor mental health only a little less than half of a day each month, according to the researchers.
"People who live in the suburbs are closer to jobs and all of the amenities that a big city can provide, but they're also far enough away from the stress of the inner city," Goetz noted.
Another important result was that people facing longer commutes experienced significantly more poor mental health days, regardless of whether they lived in a suburb, rural area, or inner city, according to Goetz.
Tighter knit communities also were happier, according to the study.
To gather information on poor mental health days, the researchers studied census data and information from other relevant sources in the US from 2002 to 2008, a period before the recession.
The study appeared online in the journal Social Indicators Research.