expard

expard constitutes an R package encompassing two primary functionalities:

  1. It serves as a simulator for electronic healthcare data, enabling the simulation of extensive patient populations observed across multiple time points. Leveraging R’s functional programming features, the package facilitates the straightforward specification of intricate relationships between drug exposures and adverse drug reactions (ADRs). These relationships may be contingent on various patient attributes such as sex, age, region, among others.

  2. The package includes a methodology designed to fit eight exposure models outlined in the associated paper to electronic healthcare data.

Usage

Simulator

The main function of the package is generate_cohort (see ?generate_cohort). For example,

library(expard)

n_drug_ADR_pairs <- 50

generate_cohort(
  n_patients = 100,
  simulation_time = 100,
  n_drug_ADR_pairs = n_drug_ADR_pairs,
  risk_model = rep("risk_model_current_use()", n_drug_ADR_pairs),
  min_chance_drug = rep(0.1, n_drug_ADR_pairs),
  avg_duration = rep(5, n_drug_ADR_pairs),
  max_chance_drug = rep(NULL, n_drug_ADR_pairs),
  prob_guaranteed_exposed = rep(1, n_drug_ADR_pairs),
  min_chance = rep(0.1, n_drug_ADR_pairs),
  max_chance = rep(0.4, n_drug_ADR_pairs),
  verbose = FALSE
)
#> Cohort
#> 
#>   No. patients:      100
#>   No. drug-ADR-pairs:    50
#>   No. time points:   100

simulates a cohort, where

Exposure Model Fit

One can fit the eight exposure models by running fit_all_models.R. For more information, see the comments to fit_model.

Acknowledgements

We gratefully acknowledge the financial support from the innovation fund (“Innovationsfonds”) of the Federal Joint Committee in Germany (grant number: 01VSF16020).

Reference

Louis Dijkstra, Tania Schink, Ronja Foraita (2024)
An Exposure Model Framework for Signal Detection based on Electronic Healthcare Data
https://arxiv.org/abs/2404.14213

Louis Dijkstra
Leibniz Institute for Prevention Research & Epidemiology
E-mail: dijkstra (at) leibniz-bips.de