To better understand the relationship between a Mediterranean diet and cardiovascular health, a team of Italian scientists recently turned to the data in the Moli-Sani cohort study, a longitudinal study of the cardiovascular health of thousands of people in southern Italy.

Across a sample of nearly 19,000 people aged 35 and older, researchers saw a 15% average decrease in participants’ risk of cardiovascular incidents for every two-point jump on the scientists’ nine-point scale of diet adherence. That wasn’t terribly surprising: previous studies have linked the plant-rich diet to a lower risk of cardiovascular disease.

But upon closer inspection of the data, the researchers realized that those benefits weren’t equally distributed. They only appeared for the well-off and well-educated. Participants with post-secondary education saw a 57% decrease in cardiovascular risk after following the diet, and those earning more than €40,000 (about $47,000) a year saw a 61% decrease. Those of lower socioeconomic status saw no benefits.

“Adhering optimally to a Mediterranean diet is not enough,” co-author and epidemiologist Marialaura Bonaccio told Quartz via email. “Other factors beyond quantity and frequency of Mediterranean food appear to influence future health outcomes: one of them may be quality of foods.”

A Mediterranean diet consists primarily of plant-based foods, with smaller proportions of seafood, dairy products, and meat. Those broad guidelines allow for a lot of individual variation.

The foods eaten by subjects of this study varied widely depending on their socioeconomic status. The more educated the participants, the more likely they were to report eating a broader variety of vegetables, plus more whole grains and organic vegetables. More educated participants had daily diets that contained higher proportions of monounsaturated fats like those found in olive oil and nutrients like calcium, vitamin D, and fiber. Meanwhile, higher-income study subjects ate more whole grain breads, fruits, nuts, and fish, and fewer meat products than subjects with lower incomes.

The Italian study couldn’t answer precisely why the diet’s effectiveness varied by income and education. Previous research in the US found nutritional inequalities between the rich and poor, driven by both knowledge of what constitutes nutritious food and—more importantly—the means to buy it.

“It is reasonable to think that higher socioeconomic groups are more conscious of what a healthy diet is and have greater material resources to afford a healthy dietary style,” Bonaccio said.