A handful of factors, such as education, income and job type, may increase the likelihood that people in their mid-50s will still be mentally sharp, a new study finds.

An analysis of data from more than 7,000 US adults showed that these factors could explain nearly 40% of the differences in the amount of cognitive abilities people had lost by age 54. Education, in particular whether a person had finished college, made the biggest difference in cognitive abilities such as memory, judgment and focus, Ohio State University scientists reported Wednesday in a scientific journal.

The researchers analyzed data from the University of Michigan’s health and retirement study, which has been tracking more than 20,000 participants for more than 20 years. The study’s database includes information on participants’ income, occupation and education, along with personal information such as marital history, religion, depression and cognitive abilities, as well as body mass index, activity levels, smoking history and other physical health details.

The data the researchers included in their analyzes came from a single set of 7,068 adults who were 54 to 65 years old in 1996 and then 20 years later.

Study co-author Hui Zheng, a professor of sociology, suspects that the reason people with a college degree do better cognitively in their 50s is they are more likely to end up with a career that makes them use their brains.

“If you have a job that is mentally stimulating, you’re lucky, because you’re using your brain all the time,” he said. “The more mental challenges in your job, the better.”

Still, going to college in our 20s isn’t the only way to avoid cognitive declines before people hit their mid-50s. Previous research has shown that having hobbies and interests that stimulate the brain, such as learning a new language, painting and writing, can also be protective.

While the researchers analyzed a wide range of things that influence our brain health as we age, the study didn’t address the influence of genetics, which could play a significant role in cognitive function, experts say.

There has been previous research showing that education, household wealth and access to health care are connected to the brain’s resilience, said Dr. Thomas Wisniewski, a neuropathologist and the director of the NYU Langone Alzheimer’s Disease Research Center and its Center for Cognitive Neurology.

Still, apart from genetics, the finding that factors that people can mostly control might explain as much as 40% of the differences in the loss of cognitive abilities at age 54 is “good news,” he said.

The Ohio study indicated that lifestyle factors — such as maintaining a healthy weight, avoiding smoking and participating in vigorous exercise — had little impact on the rate of cognitive decline after age 54. However, Wisniewski, who was not involved in the study, isn’t t convinced that “there’s nothing you can do about it.”

“That’s not true in my experience as a clinician and it’s not what’s been shown in other studies,” he said.

More on brain health and memory

When it comes to slowing down cognitive decline, physical activity and a healthy diet can be highly beneficial, Wisniewski said. Managing medical conditions such as obstructive sleep apnea, diabetes, hypertension and cholesterol are also protective.

To illustrate the power of vigorous physical activity even in people in their 70s, he points to one of his recent papers that described two patients who had been diagnosed with mild cognitive impairment and who also had biological markers that suggested they would develop Alzheimer’s disease.

Once the patients either retired or cut the time spent on the job, they had more time for vigorous exercise. And both upped the amount of time spent working out. Over the course of 15 years in one patient and 18 in the other, there were no signs of cognitive decline. In fact, one of the patients’ cognition improved slightly.

“What’s good for the heart is good for the brain,” Wisniewski said.