The rate of U.S. teen vaping and marijuana use is on the rise, while their use of other substances including alcohol and cigarettes is declining, according to a new study.

Researchers tracking substance use trends among U.S. teens over the past 30 years found substance use has generally declined, except for overall marijuana use and vaping nicotine and marijuana, HealthDay reports.

The percentage of U.S. teens who said they had vaped nicotine in the past month increased from 7% to 17% between 2017 and 2019, the study found. Marijuana vaping rose from just over 3% to almost 10% during that time.

Rates of substance use were highest among teens who had a job or who spent a lot of time with friends, without adults around, the study found. Substance use was least likely to occur among teens who did not spend a lot of time around friends or who took part in sports or other structured activities.

“Years of research show that when young people are engaged in activities they enjoy and feel are meaningful, they have less reason to turn to substance use to soothe their boredom or seek sensation,” said Linda Richter, vice president of prevention research and analysis for Partnership to End Addiction, who was not involved in the study.