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 data_process function.

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

TRUE or FALSE. Create a table of the number of drugs consumed everyday by every individual (FALSE by default).

cores

The number of CPU cores to use. See detectCores.

Details

individual_stats & stats: Possible values are

Value

list:

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)

[Package polypharmacy version 1.0.0 Index]