Having a college education may help you live longer in the U.S. despite an overall decline in life expectancy among U.S. adults in recent years, a new study finds.

Researchers examined U.S. National Vital Statistics System data on more than 2.2 million deaths in 2010 and 2.4 million in 2017 among white and black non-Hispanic adults to estimate the impacts of sex, race and different levels of education on life expectancy at age 25 in the United States, based on American Community Survey midyear population estimates.

"From 2010 to 2017, estimated educational differences in adult life expectancy increased for white and black men and women," the study says. "In almost all race-sex groups, this was associated with both decreasing life expectancy among persons with less than a 4-year college education and increasing life expectancy among the college educated."

Overall life expectancy declined between those two years, from 79.34 years to 79.15 years, largely due to "unhealthy alcohol use, drug use and suicide, which were not evenly shared across socioeconomic strata," according to the study.

"From 1990 to 2010, life expectancy continued to increase among white adults despite increasing educational differences. Since 2010, however, adult life expectancy declined among white men and women, largely due to the decline in adult life expectancy among all non–college-educated groups," the study, published in the Journal of the American Medical Association on Tuesday, says.

Among blacks, life expectancy declined among the lowest-educated group of black men and remained relatively unchanged for those with some or a completed college education, while black women experienced a significant increase in life expectancy across all education groups, especially among the highest education group.

"Nevertheless, increases in life expectancy among black adults were substantially reduced in the 2010-2017 period. Particularly among black men, the stagnation in adult life expectancy during those 7 years ended a 2-decade long improvement in life expectancy for this group," the study says.

Further, the researchers estimated the mean number of years of life lost by cause of death between the ages of 25 and 84 and by education level from 2010 to 2017, broken down into nine categories: circulatory diseases, cancer, smoking-related diseases, diabetes, drug use, alcohol use, suicide, firearm, and all other causes. Circulatory diseases, cancer and smoking-related disease were the leading disorders associated with years of life lost across all race and sex groups, though the number of years lost to cardiovascular diseases and smoking-related disease decreased over the time period.

The number of years of life lost to drug use, alcohol use and suicide increased significantly across all groups. Educational differences in years of life lost also increased in the time period across all race and sex groups, with drug use deaths largely contributing to the increase.