| ind_simult {polypharmacy} | R Documentation |
Assess polypharmacy based on the daily simultaneous consumption of medications
Description
Calculates various metrics measuring the number of distinct medications consumed daily for every individual of the study cohort over the study period and provides cohort descriptive statistics on those metrics.
Usage
ind_simult(
processed_tab,
individual_stats = c("mean", "min", "median", "max"),
stats = c("mean", "sd", "min", "p5", "p10", "p25", "median", "p75", "p90", "p95",
"max"),
calendar = FALSE,
cores = parallel::detectCores()
)
Arguments
processed_tab |
Table of individual drug treatments over the study period. Created by |
individual_stats |
Descriptive statistics of daily consumption over the study period to calculate for every individual. See Details for possible values. |
stats |
Cohort descriptive statistics to calculate on the polypharmacy indicator. See Details for possible values. |
calendar |
|
cores |
The number of CPU cores to use. See |
Details
individual_stats & stats: Possible values are
-
'mean','min','median','max','sd'; -
'pX'where X is an integer value in ]0, 100]; -
'q1'='p25','q2'='p50'='median',q3='p75'.
Value
list:
-
indic:data.tableindicating eachstats(columns) for eachindividual_stats(rows). -
stats_id:data.tableindicating eachindividual_statsfor each individuals (all cohort). -
min_conso:data.tableindicating eachstatsfor the number of days where an individual consume at leastXdrugs. -
calendar: Ifcalendar=TRUE,data.tableindicating the number of drugs consumed for each day (only for individuals who has at least 1 day with 1 drug consumption).
Examples
rx1 <- data.frame(id = c(1, 1, 2),
code = c("A", "B", "A"),
date = c("2000-01-01", "2000-01-04", "2000-01-08"),
duration = c(5, 7, 5))
cohort1 <- data.frame(id = as.numeric(1:3),
age = c(45, 12, 89),
sex = c("F", "F", "M"))
rx_proc1 <- data_process(Rx_deliv = rx1, Rx_id = "id", Rx_drug_code = "code",
Rx_drug_deliv = "date", Rx_deliv_dur = "duration",
Cohort = cohort1, Cohort_id = "id",
study_start = "2000-01-01", study_end = "2000-01-15",
cores = 1)
dt_ind_simult <- ind_simult(rx_proc1, calendar = TRUE, cores = 1)