Cholesterol levels in children and teens improved in the latest analysis of U.S. health surveys, yet only half of them had readings considered ideal.

Overall, 7% of kids had high cholesterol in surveys from 2009 to 2016. That was down from 10% a decade earlier. In children, high levels mean 200 or above and ideal measures are below 170.

The results were published Tuesday in the Journal of the American Medical Association.

The researchers say the mixed bag of results could reflect stubborn rates of childhood obesity, offset by U.S. kids eating fewer snack foods containing unhealthy trans fats. Manufacturers began phasing those out before a 2018 U.S. ban.

In the analysis, researchers used 1999-2016 government surveys of 26,000 kids aged 6 to 19 who had home interviews, physical exams and lab tests.

About 1 in 4 teens and 1 in 5 younger children had unhealthy levels of at least one of type of blood fat, including cholesterol and triglycerides.

High cholesterol in childhood can lead to changes that cause blood vessels to narrow, said Dr. Amanda Perak, the study's lead author and a heart specialist at Chicago's Lurie Children's Hospital. Those changes put kids at risk for heart attacks and other heart trouble in adulthood, she said.

In most cases, kids can improve cholesterol levels by adopting healthier habits — eating more fruits, vegetables, whole grains and less processed food, and exercising more, Perak said.

"Lifestyle contributes in the vast majority of cases," she said.

Obesity contributes to unhealthy cholesterol levels yet rates have remained stagnant for U.S. kids and adults. In 2015-16, 21% of teens, 18% of children aged 6-11, and 40% of adults were obese, according to the most recent data from the U.S. Centers for Disease Control and Prevention.

FOLLOW NBC HEALTH ON TWITTER & FACEBOOK