People 70 and older who consume a lot of protein and fat relative to carbohydrates are less likely to become cognitively impaired, according to a Mayo Clinic study published in the Journal of Alzheimer’s Disease.

The research highlights the importance of a well-rounded diet, said lead author Rosebud Roberts, M.B., Ch.B., a Mayo Clinic epidemiologist, in a press release.

“We think it’s important that you eat a healthy balance of protein, carbohydrates and fat, because each of these nutrients has an important role in the body,” Dr. Roberts said.

Researchers tracked 1,230 people ages 70 to 89 who provided information on what they ate during the previous year. At that time, their cognitive function was evaluated by an expert panel of physicians, nurses and neuropsychologists. Of those participants, only the roughly 940 who showed no signs of cognitive impairment were asked to return for follow-up evaluations of their cognitive function. About four years into the study, 200 of those 940 were beginning to show mild cognitive impairment, problems with memory, language, thinking and judgment that are greater than normal age-related changes.

Those whose diets were highest in fat–compared to the lowest–were 42 percent less likely to face cognitive impairment, and those who had the highest intake of protein had a reduced risk of 21 percent.

When total fat and protein intake were taken into account, people with the highest carbohydrate intake were 3.6 times likelier to develop mild cognitive impairment.

The study was funded by the National Institute on Aging.