ABSTRACT
Simplified exposure classifications, such as ever exposed versus never exposed, are commonly used in pharmacoepidemiology. However, this simplification may obscure complex use patterns relevant to researchers. We introduce tame, an R package that offers a novel method for classifying medication use patterns, capturing complexities such as timing, dose, and concurrent medication use in real-world data. The core innovation of tame is its bespoke distance measure, which identifies complex clusters in medication use and is highly adaptable, allowing customization based on the Anatomical Therapeutic Chemical (ATC) Classification System, medication timing, and dose. By prioritizing a robust distance measure, tame ensures accurate and meaningful clustering, enabling researchers to uncover intricate patterns within their data. The package also includes tools for visualizing and applying these clusters to new datasets. In a national Danish cohort study, tame identified nuanced antidepressant use patterns before and during pregnancy, demonstrating its capability to detect complex trends. tame is available on the Comprehensive R Archive Network at [https://CRAN.R-project.org/package=tame] under an MIT license, with a development version on GitHub at [https://github.com/Laksafoss/tame]. tame enhances medication use classification by detecting complex interactions and offering insights into real-world medication usage, thus improving stratification in epidemiological studies.
Competing Interest Statement
The authors have declared no competing interest.
Funding Statement
Yes
Author Declarations
I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.
Yes
I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.
Yes
I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).
Yes
I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.
Yes
Footnotes
The manuscript has been revised to increase the emphasis on the novel distance measure, include code examples and a graphic illustration of the method.