Differences in lifestyles between socioeconomic groups are pretty pronounced. And now scientists have found a depressing new marker. Hidden in the sewage lies a clear difference between wealthy areas and poorer ones.

No, it's not gold in sewage this time. It's the remnants of the food we eat and the drugs we take that can paint a broader picture of how we live.

The study took place in Australia, where, over the course of the week of the national census in 2016, samples were taken from 22 wastewater treatment plant catchments, and examined for 42 biomarkers of things such as drugs and dietary metabolites.

These were later compared with census data on metrics such as rent prices, employment and education levels for each area.

"We show the extent to which consumption of chemicals such as opioids and illicit drugs are associated with sociodemographics. We also examine chemicals that reflect individuals' consumption of food components in wastewater and show that disparities in diet are associated with educational level," the researchers write in their paper.

"Our study shows that chemicals in wastewater reflect the social, demographic, and economic properties of the respective populations and highlights the potential value of wastewater in studying the sociodemographic determinants of population health."

What they found is sobering.

In wealthier areas, biomarkers were consistent with a better diet. Metabolites produced by the dietary intake of B vitamins (not supplements) were significantly more abundant in areas with higher rents, in agreement with previous research that found socioeconomically disadvantaged groups are less likely to meet nutritional guidelines.

Wealthier and better educated areas also had much higher concentrations of the biomarkers associated with eating a lot of fresh fruit and vegetables, as well as grains. All of these are associated with a healthier overall diet.

Interestingly, wealthier areas also had higher caffeine consumption. Coffee consumption is pretty universal, but is higher among better-off socioeconomic groups, especially ground coffee and espresso as opposed to instant coffee.

"We suggest," the researchers wrote, "that increased caffeine consumption in socioeconomically advantaged groups may reflect 1) greater financial freedom to indulge in caffeinated beverages (i.e., coffee) and/or 2) cultural institutionalisation of regular coffee drinking among advantaged and/or educated populations."

In lower socioeconomic areas, there were significantly higher levels of prescription medication for treating depression (desvenlafaxine, amitriptyline and citalopram), chronic pain (opioids such as methadone, codeine, tramadol and oxycodone, as well as pregabalin, for neuropathy) and blood pressure (atenolol).

"We considered antidepressants as a proxy for psychological distress," the researchers noted.

They were even able to link demographics with specific types of antidepressants. A higher proportion of labourers were prescribed desvenlafaxine. Amitriptyline was most often prescribed to people who didn't finish high school. And people taking citalopram tended to live alone, and were often separated or divorced.

We don't have to take the sewage at face value, either. All of these results appear to be consistent with other studies into the lifestyles of demographic groups.

Wastewater-based epidemiology is relatively new, and to date has been used primarily to study and monitor the use of drugs, both legal and illegal.

This study, the researchers said, shows that it can also be used as a means of studying the general health of human populations, and identifying areas that aren't doing so well.

"Our study shows that chemicals in wastewater reflect the social, demographic, and economic properties of the respective populations and highlights the potential value of wastewater in studying the sociodemographic determinants of population health," the researchers wrote.

The research has been published in PNAS.