Aging is inevitable, at least if you are fortunate enough to live a long life; but the ability to function independently along the way isn’t.

Staying mobile is one of the key components to healthy aging and being able to live independently. By 2030 nearly 20 percent of the US population will be 65 years old or older. Many will become physically impaired, requiring them to leave their homes and move in with children or into an assisted living facility or nursing home.

We tend to think of chronic diseases more than physical functioning as we age, but maintaining physical function — being able to dress yourself or walk around the block — is crucial to being able to live independently.

New research suggests eating a healthy diet is a hedge against losing the ability to function independently as you age.

Researchers at Brigham and Women’s Hospital (BWH) looked at the dietary patterns of nearly 55,000 women participating in the Nurses’ Health Study to determine if there was an association between diet and physical function over time.

“Little research has been done on how diet impacts physical function later in life. We study the connection between diet and many other aspects of health, but we don’t know much about diet and mobility,” Francine Grodstein, senior author of the study, said in a statement.

The women in the study were asked a series of 10 questions regarding any physical limitations they experienced in the areas of bathing/dressing, walking a block, walking several blocks, walking over a mile, bending/kneeling, climbing stairs, handling bags of groceries, and performing moderate and vigorous activities every four years.

The quality of women's diets was measured every four years by comparing the food frequency questionnaires women filled out to the Alternative Healthy Eating Index, an assessment tool which incorporates food and nutrients that predict the risk of chronic disease.

After 18 years of follow-up, women who had a higher intake of fruits and vegetables and a lower intake of sugary beverages, trans fats and sodium had lower rates of physical impairment than those who didn’t eat as healthily. Moderate alcohol consumption seemed to be helpful, as well.

Certain foods were particularly associated with maintaining physical function: oranges, orange juice, apples, pears, romaine or leaf lettuce and walnuts. The link between these foods and physical functioning was not as strong as the association with overall healthy eating. In other words, the general quality of the diet was more important than the intake of any specific foods.

We tend to think of chronic diseases more than physical functioning as we age, but maintaining physical function — being able to dress yourself or walk around the block — is crucial to being able to live independently, according to Kaitlin Hagan, first author of the study and a postdoctoral fellow at BWH.

People who lose their ability to function physically are more likely to be hospitalized, end up in a nursing home or die earlier.

A healthy diet is not the only factor that influences a person’s ability to avoid age-related physical impairment; staying physically active plays a role, too.

More research is needed to better understand the aspects of diet and lifestyle that affect physical function, but this study makes it clear that good general nutrition brings good general health, and gives you one more reason to follow a healthy diet.

The study is published in the Journal of Nutrition.