time_to_initiation {AdhereR} | R Documentation |
Computation of initiation times.
Description
Computes the time between the start of a prescription episode and the first dispensing event for each medication class.
Usage
time_to_initiation(
presc.data = NULL,
disp.data = NULL,
ID.colname = NA,
medication.class.colnames = NA,
presc.start.colname = NA,
disp.date.colname = NA,
date.format = "%d.%m.%Y",
suppress.warnings = FALSE,
return.data.table = FALSE,
...
)
Arguments
presc.data |
A |
disp.data |
A |
ID.colname |
A string, the name of the column in |
medication.class.colnames |
A |
presc.start.colname |
A string, the name of the column in
|
disp.date.colname |
A string, the name of the column in
|
date.format |
A string giving the format of the dates used in
the |
suppress.warnings |
Logical, if |
return.data.table |
Logical, if |
... |
other possible parameters |
Details
The period between the start of a prescription episode and the first dose administration
may impact health outcomes differently than omitting doses once on treatment or
interrupting medication for longer periods of time. Primary non-adherence (not
acquiring the first prescription) or delayed initiation may have a negative
impact on health outcomes. The function time_to_initiation
calculates
the time between the start of a prescription episode and the first dispensing event, taking
into account multiple variables to differentiate between treatments.
Value
A data.frame
or data.table
with the following columns:
-
ID.colname
the unique patient ID, as given by theID.colname
parameter. -
medication.class.colnames
the column(s) with classes/types/groups of medication, as given by themedication.class.colnames
parameter. -
episode.start
the date of the first prescription event. -
first.disp
the date of the first dispensing event. -
time.to.initiation
the difference in days between the first dispensing date and the first prescription date.
Examples
time_init <- time_to_initiation(presc.data = durcomp.prescribing,
disp.data = durcomp.dispensing,
ID.colname = "ID",
medication.class.colnames = c("ATC.CODE", "FORM", "UNIT"),
presc.start.colname = "DATE.PRESC",
disp.date.colname = "DATE.DISP",
date.format = "%Y-%m-%d",
suppress.warnings = FALSE,
return.data.table = TRUE);