Authors: Le Zhang; Tyra Lagerberg; Qi Chen; Laura Ghirardi; Brian M D'Onofrio; Henrik Larsson; Alexander Viktorin; Zheng Chang · Research

How Can We Predict ADHD Medication Dosage and Duration from Prescription Data?

A new algorithm uses machine learning to predict ADHD medication dosage and treatment duration from prescription data, enabling better research on medication use patterns.

Source: Zhang, L., Lagerberg, T., Chen, Q., Ghirardi, L., D'Onofrio, B. M., Larsson, H., Viktorin, A., & Chang, Z. (2021). Prediction of treatment dosage and duration from free-text prescriptions: an application to ADHD medications in the Swedish prescribed drug register. Evidence-Based Mental Health, 24(4), 146–152. https://doi.org/10.1136/ebmental-2020-300231

What you need to know

  • A new algorithm uses machine learning to accurately predict ADHD medication dosage and treatment duration from free-text prescription data
  • The algorithm performs well, with 96.8% accuracy for dosage prediction in external validation
  • When applied to Swedish prescription data, the algorithm revealed that young adults have the highest rates of discontinuing ADHD medication treatment
  • The prescribed daily dose of methylphenidate increased substantially with age for both males and females

Using Prescription Data to Study Medication Use

Electronic health records and prescription databases have become valuable sources of information for studying how medications are used in the real world. However, getting accurate data on medication dosage and treatment duration from these databases can be challenging. Some databases contain structured information on daily dosage and days of medication supply, but many do not. Instead, dosage information is often provided in unstructured free-text form.

Previous approaches to estimate dosage and duration from prescription data have limitations. Some methods rely on information from future prescriptions, which can introduce bias. Other approaches use rigid rules to extract dosage information from text, but these are not flexible enough to handle all the ways dosage can be described.

Researchers in Sweden developed a new algorithm that uses machine learning to predict medication dosage from free-text prescriptions and estimate treatment duration. They applied this algorithm to study patterns of ADHD medication use.

How the Algorithm Works

The algorithm uses several steps to process prescription data:

  1. Text preprocessing: Cleans up the prescription text and handles special cases like titration (gradual dose increases).

  2. Natural language processing: Uses machine learning models to predict whether the prescription text contains enough information to determine dosage, and if so, predicts the daily dosage.

  3. Dosage prediction: For prescriptions without clear dosage information, uses other data like previous prescriptions or patient characteristics to estimate dosage.

  4. Treatment period estimation: Calculates expected treatment length for each prescription and combines them into continuous treatment periods, accounting for factors like stockpiling of medication.

The researchers trained the algorithm on a sample of 8,000 ADHD medication prescriptions and tested it on a separate validation sample of 1,000 prescriptions.

High Accuracy in Predicting Dosage

When tested on the validation sample, the algorithm showed impressive performance:

  • 99.2% accuracy in identifying prescriptions with sufficient dosage information
  • 96.3% accuracy in predicting daily dosage for prescriptions with clear dosage information
  • 96.8% overall accuracy in predicting daily dosage across all prescriptions

This compares favorably to other published algorithms, which have reported accuracies of 90-94% for dosage prediction.

Revealing Patterns of ADHD Medication Use

The researchers applied their algorithm to analyze over 600,000 ADHD medication prescriptions from the Swedish Prescribed Drug Register in 2013. This allowed them to examine patterns of medication use across different age groups.

Treatment Discontinuation Varies by Age

By estimating continuous treatment periods, the researchers could look at how long patients stayed on ADHD medication. They found that discontinuation rates varied substantially between age groups:

  • Children (ages 6-12) had the lowest discontinuation rates, with about 70-75% estimated to remain on treatment after 1 year.
  • Young adults (ages 18-29) had the highest discontinuation rates. Only 35-40% were estimated to still be on treatment after 1 year.
  • Adolescents and adults had intermediate discontinuation rates.

These findings align with previous research showing that young adults are most likely to stop ADHD medication treatment. There are several potential reasons for this:

  • Some people’s ADHD symptoms may improve as they get older, reducing the need for medication.
  • Young adults may face more challenges in consistently taking medication or attending follow-up appointments.
  • There may be more concerns about medication side effects in this age group.

Dosage Increases with Age

The algorithm also allowed the researchers to examine prescribed daily doses of methylphenidate (the most common ADHD medication) across age groups. They found that dosage increased substantially with age for both males and females:

  • Only 5-7% of children were prescribed high doses (>60 mg/day).
  • 22% of male adolescents and 15% of female adolescents received high doses.
  • Among older adults, 55% of males and 41% of females were on high doses.

This pattern likely reflects the need to adjust dosage based on body weight and metabolism as patients get older. It highlights the importance of individualized dosing approaches for ADHD medication.

Implications for Research and Clinical Practice

This new algorithm provides a powerful tool for studying patterns of medication use from prescription databases. Compared to previous methods, it offers several advantages:

  • Greater flexibility in handling different ways dosage information can be written
  • Ability to account for complex prescribing patterns like dose titration
  • Less reliance on information from future prescriptions, which can introduce bias

The structured output from the algorithm - including treatment duration, start and end dates, and daily dosage - can serve as the foundation for a wide range of studies on medication utilization, effectiveness, and safety.

For clinicians, the findings on age-related patterns of ADHD medication use underscore some key points:

  • The transition to young adulthood may be a particularly high-risk time for treatment discontinuation. Extra support and follow-up may be needed for patients in this age group.
  • Dose adjustments are often needed as patients get older. Regular review of dosage and treatment response is important.
  • There is substantial variation in dosing between individuals. An individualized approach to finding the optimal dose for each patient is crucial.

Conclusions

  • A new machine learning algorithm can accurately predict ADHD medication dosage and treatment duration from free-text prescription data.
  • When applied to Swedish prescription data, the algorithm revealed important age-related patterns in ADHD medication use.
  • This approach opens up new possibilities for using prescription databases to study real-world medication use patterns.
  • The findings highlight the need for individualized and age-appropriate approaches to ADHD medication treatment.
Back to Blog

Related Articles

View All Articles »