There's a reason people say 'cheese' to make you smile.

A huge genetic analysis has found that people with better mental well-being tend to live longer and healthier – and certain lifestyle choices, like eating more cheese, could play a significant role in that effect.

Researchers in China didn't comb through the genes of millions of Europeans only to show that gouda is good-a for you, but that is one of the more attention-grabbing results. After all, who doesn't want to be told that eating more cheese will help them live longer and healthier lives?

Still, there's a lot more to the findings than just eating foods that make you feel happy.

Past observational studies have found that happiness can have an impact on how a person ages, even more so than smoking. But these are just associations that could be confounded by other, overlooked factors, such as socioeconomic status.

The current study is different. It employs an analytical method known as Mendelian randomization, which is a valuable tool to explore what factors influence our genes and lead to certain health outcomes.

It's one of just a few methods researchers can use to predict a potentially causal effect without having to conduct a clinical trial.

Across eight different population datasets in Europe, each of which includes between 38,000 and 2.4 million individuals, researchers found potential causal evidence that better mental wellbeing, measured by life satisfaction, mood, neuroticism, and depressive symptoms, can help you live a longer and healthier life.

"Our study offers encouraging evidence that enhancing mental well-being is a viable avenue to healthy aging, regardless of an individual's [socioeconomic status]," the authors conclude.

Zooming in on 33 individuals from the European datasets, the team of researchers explored what intermediate factors might be driving the causation between mental well-being and healthy aging, including lifestyle choices, like smoking, individual behaviors, like medication use, physicality, like muscle mass, and diseases, like diabetes and cancer.

This is where cheese comes into play. Of all 33 individuals considered, those who reported eating more cheese and fruit tended to have higher mental well-being scores. What's more, eating more cheese had a 3.67 percent positive impact on their self-rated health and their lifespans.

To put that in perspective, smoking cigarettes had a 4.56 percent negative impact on health aging factors, and eating fruit had a 1.96 percent positive impact.

Interestingly, researchers found that TV watching time was the lifestyle factor with the greatest negative effect on health aging factors: an impact of 7.39 percent.

Bridging the divide between mental and physical health is highly complex work, and no study can consider every single possible variable that might be having an influence. That said, the authors of the current research argue their study is "meticulous and exhaustive" in its consideration of possible influences, at least among those of European descent.

Further research will be needed to consider why eating cheese might have such an outsized influence on healthy aging, as compared to, say, eating fruit.

While high fat foods are often considered bad for human health, studies suggest that in moderation, the consumption of dairy fat can lower cholesterol and reduce the risk of cardiovascular disease and all-cause mortality.

Whole fat dairy products, like ice cream, are linked to poorer mental health, but some types of cheese may be different when eaten in a well-balanced diet.

In a recent study in Japan, for instance, greater cheese consumption was linked to better cognitive function, and some other research suggests that cheese can trigger the brain's dopamine pathways, leading to feelings of pleasure.

From these initial studies, it seems like cheese may be good for your mind and body. If you're looking to live longer and healthier, you could do worse than putting a sprinkle of parmesan on your pasta every now and then.

The study was published in Nature Human Behavior.