We all know how important a fulfilling job, a loving partner and even a pet can be to one's sense of satisfaction in life. But where you live plays a bigger role than you might think, and for those who live in cities, the differences in the factors that make for high quality of life can be extreme. 

The effect is so powerful that self-reported happiness  (and unhappiness) of people who move to a new city tends to gravitate toward the average level of those who already live there. That's according to a working paper entitled "Unhappy Cities" by the U.S. National Bureau of Economic Research. "Newer residents of [unhappy] cities appear to be as unhappy as longer term residents, and yet some people continue to move to these areas," the paper states.

To figure out why certain cities -- like Detroit and New York, for example -- seem to cause people to become unhappy, the authors examined a number of factors like public transportation, climate and income. In the process, they also discovered a few reasons why residents of the happiest cities feel so much contentment. Here's some research, from that report and other sources, that helps to explain why certain city dwellers feel they've got it made.

Shorter commutes

No surprise here: the more time people spend commuting, the more dissatisfied and anxious they feel, a study by the United Kingdom's Office for National Statistics (ONS) found. In terms of overall well-being, the effect was relatively small, but the ONS deemed it statistically significant.

The report also looked at the way people get to work and the impact this has on their happiness. Here, the ONS found that those who commute by train or subway are happier than those who take a taxi or a bus.

Another study from McGill University in Montreal backed those findings up. The research suggested that people who are able to be productive on their way to work -- by reading, writing or talking on the phone for example -- are happier than their fellow commuters. 

Mild winters

It might seem obvious that inhabitants of sunny Honolulu would be happier than the frequently snowed in residents of Buffalo New York. "The correlation between warm weather and metropolitan growth is well known ... and it is certainly possible that tough winters are depressing," the authors of the "Unhappy Cities" report write. 

However, at best the happiness boost that cities with mild winters get is small. And it also turns out a little rain doesn't hurt anyone; there isn't any correlation between annual inches of rainfall and unhappiness. 

Social trust

"The most powerful correlate of happiness in cities is social trust," Charles Montgomery, author of Happy City, told Pacific Standard. And the level of social trust within a city is tied to how walkable it is, he says.

"People who live in monofunctional, car-dependent neighbourhoods outside urban centres are much less trusting of other people than people who live in walkable neighbourhoods where housing is mixed with shops, services and places to work," Montgomery writes in the book. 

Green spaces

City residents are prone to feeling claustrophobic in overcrowded urban areas, so it's no wonder they love their parks and recreation areas. That's what Ericsson Consumer Lab found when it studied the aspects of city life that people from around the world are the most and least satisfied with.

"Taken as a whole, among the measured factors, the one showing highest correlation to happiness with life in the city is the perceived abundance of clean, green parks and public spaces," according to the report. 

Human capital

The "Unhappy Cities" paper saw that areas with a more educated population report higher levels of happiness, a finding that's supported by past research. A 2010 Gallup-Healthways Metro happiness index found that a city's wellbeing is positively correlated with human capital, or the share of the population with a B.A. and above. This correlation was stronger than any of the other variables including unemployment and income and wages.