Lives around the world are getting longer, and have been for a long time. But more time isn’t always better—the question is if humanity is gaining more good years of life. Discussions about end of life care are starting to recognize this nuance, that just because modern medicine can keep someone alive doesn’t mean it should in every circumstance.

But even before those decisions have to be made, the question remains: “Are we living longer healthy lives as well as longer lives?” So asks a new study published in the American Journal of Public Health. The researchers, from the University of Southern California and Nihon University in Tokyo, looked at data about general life expectancy in the United States from 1970 to 2010 , as well as life expectancy with disability and without. (Disability was defined as “having any limitation of activity.”)

This research digs deeper into what a longer average lifespan really means. Are some people staying healthy longer while those who get sick die more quickly? (The study calls this option “compression of morbidity.”) Are we just better at treating illness which means more sick people are living longer? Or are both healthy and unhealthy people seeing years added to their lives in relatively equal measure?

Over the 40-year study period, life expectancy at birth increased by 9.2 years for men and by 6.4 years for women, and about half of that increase was accounted for by people living longer after age 65. Life expectancy with disability increased by 4.7 years for men and 3.9 for women; life expectancy without disability increased by 4.5 years for men and 2.7 for women.

So overall, people are living longer, with or without disability. When the researchers combined all their measurements, though, they found that the proportion of a person’s life in which they could be expected to be disability-free decreased (by 4.1 percent for men and by 3.3 percent for women), meaning that more of people’s lives are being spent living with disability.

However, for people 65 and older, the proportion of life spent with disability went down (by 1.3 percent for men and 2.5 percent for women)—a finding that runs counter to the idea that youth and good health necessarily go together. But it’s a trend scientists have tracked for a while.

“This improvement among the old, but not the young, reinforces much of the existing work on trends in disability,” the study reads.

Why this might be is unclear—the researchers speculate that “some of the increase in disability among the younger population likely resulted from change in emphasis on mental health, the rise in autism and attention deficit hyperactivity disorder, and the changing patterns of drug use across time.”

This is a very broad definition of “disability”—the takeaway here is mostly that people are spending more time living with health problems that affect their ability to function in some way, and surprisingly, it’s worse for the young. So if doctors and policymakers want to increase the number of healthy years a person lives, “clearly, there is a need to maintain health and reduce disability at younger ages,” the researchers write.