| CMA_polypharmacy {AdhereR} | R Documentation |
CMA constructor for polypharmacy.
Description
Constructs a CMA (continuous multiple-interval measures of medication availability/gaps) object for polypharmacy.
Usage
CMA_polypharmacy(
data = data,
medication.groups = medication.class.colname,
CMA.to.apply = NA,
aggregate.first = TRUE,
aggregation.method = NA,
aggregation.method.arguments = NA,
thresholds = NA,
ID.colname = NA,
event.date.colname = NA,
event.duration.colname = NA,
event.daily.dose.colname = NA,
medication.class.colname = NA,
carry.only.for.same.medication = NA,
consider.dosage.change = NA,
followup.window.start = 0,
followup.window.start.unit = c("days", "weeks", "months", "years")[1],
followup.window.duration = 365 * 2,
followup.window.duration.unit = c("days", "weeks", "months", "years")[1],
observation.window.start = 0,
observation.window.start.unit = c("days", "weeks", "months", "years")[1],
observation.window.duration = 365 * 2,
observation.window.duration.unit = c("days", "weeks", "months", "years")[1],
date.format = "%m/%d/%Y",
summary = "CMA for polypharmacy",
force.NA.CMA.for.failed.patients = TRUE,
parallel.backend = c("none", "multicore", "snow", "snow(SOCK)", "snow(MPI)",
"snow(NWS)")[1],
parallel.threads = "auto",
suppress.warnings = FALSE,
suppress.special.argument.checks = TRUE,
...
)
Arguments
data |
A |
medication.groups |
A string with the name of the column containing the medication groups. If multiple medication classes should belong to the same treatment group, they can be differentiated here (important to investigate treatment switches) |
CMA.to.apply |
A string giving the name of the CMA function (1 to 9) that will be computed for each treatment group. |
aggregate.first |
Logical, if |
aggregation.method |
A string giving the name of the function to
aggregate CMA values of medication group, or |
aggregation.method.arguments |
optional, A named list of additional arguments to the
function given in |
thresholds |
optional, a number to apply as threshold between aggregation and summarizing. |
ID.colname |
A string, the name of the column in
|
event.date.colname |
A string, the name of the column in
|
event.duration.colname |
A string, the name of the column in
|
event.daily.dose.colname |
A string, the name of the column in
|
medication.class.colname |
A string, the name of the column in
|
carry.only.for.same.medication |
Logical, if |
consider.dosage.change |
Logical, if |
followup.window.start |
If a |
followup.window.start.unit |
can be either "days",
"weeks", "months" or "years", and represents the time
units that |
followup.window.duration |
either a number representing the
duration of the follow-up window in the time units given in
|
followup.window.duration.unit |
can be either "days",
"weeks", "months" or "years", and represents the time
units that |
observation.window.start, observation.window.start.unit, observation.window.duration, observation.window.duration.unit |
the definition of the observation window (see the follow-up window parameters above for details). Can be defined separately for each patient and treatment group. |
date.format |
A string giving the format of the dates used in the
|
summary |
Metadata as a string, briefly describing this CMA. |
force.NA.CMA.for.failed.patients |
Logical describing how the
patients for which the CMA estimation fails are treated: if |
parallel.backend |
Can be "none" (the default) for single-threaded
execution, "multicore" (using |
parallel.threads |
Can be "auto" (for |
suppress.warnings |
Logical, if |
suppress.special.argument.checks |
Logical parameter for internal
use; if |
... |
other possible parameters |
Value
An S3 object of class CMA_polypharmacy with the
following fields:
-
dataThe actual event data, as given by thedataparameter. -
ID.colnamethe name of the column indatacontaining the unique patient ID, as given by theID.colnameparameter. -
event.date.colnamethe name of the column indatacontaining the start date of the event (in the format given in thedate.formatparameter), as given by theevent.date.colnameparameter. -
event.duration.colnamethe name of the column indatacontaining the event duration (in days), as given by theevent.duration.colnameparameter. -
event.daily.dose.colnamethe name of the column indatacontaining the prescribed daily dose, as given by theevent.daily.dose.colnameparameter. -
medication.class.colnamethe name of the column indatacontaining the classes/types/groups of medication, as given by themedication.class.colnameparameter. -
carry.only.for.same.medicationwhether the carry-over applies only across medication of the same type, as given by thecarry.only.for.same.medicationparameter. -
consider.dosage.changewhether the carry-over is adjusted to reflect changes in dosage, as given by theconsider.dosage.changeparameter. -
followup.window.startthe beginning of the follow-up window, as given by thefollowup.window.startparameter. -
followup.window.start.unitthe time unit of thefollowup.window.start, as given by thefollowup.window.start.unitparameter. -
followup.window.durationthe duration of the follow-up window, as given by thefollowup.window.durationparameter. -
followup.window.duration.unitthe time unit of thefollowup.window.duration, as given by thefollowup.window.duration.unitparameter. -
observation.window.startthe beginning of the observation window, as given by theobservation.window.startparameter. -
observation.window.start.unitthe time unit of theobservation.window.start, as given by theobservation.window.start.unitparameter. -
observation.window.durationthe duration of the observation window, as given by theobservation.window.durationparameter. -
observation.window.duration.unitthe time unit of theobservation.window.duration, as given by theobservation.window.duration.unitparameter. -
date.formatthe format of the dates, as given by thedate.formatparameter. -
summarythe metadata, as given by thesummaryparameter. -
event.infothedata.framecontaining the event info (irrelevant for most users; seecompute.event.int.gapsfor details). -
aggregation.methodthe aggregation method to combine CMA values from different groups. -
computed.CMAthe class name of the computed CMA. -
medication.groupsadata.framewith medication groups and classes -
CMAthedata.framecontaining the actualCMAestimates for each participant (theID.colnamecolumn) and sometimes treatment group, with columns:-
ID.colnamethe patient ID as given by theID.colnameparameter. -
medication.groupsonly when no aggregation method is used (aggregation.method = NA); the treatment group as given by themedication.groupsparameter. -
CMAthe treatment episode's estimated CMA.
-
Examples
## Not run:
CMA_PP <- CMA_polypharmacy(data = med.events.pp,
medication.groups = med.groups,
CMA.to.apply = "CMA7",
aggregate.first = TRUE, # aggregate before summarizing
aggregation.method = "mean", # compute mean of CMAs
aggregation.method.arguments = list(na.rm = TRUE), # remove NA's during calculation
thresholds = NA, # don't apply threshold
ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
followup.window.start=0,
observation.window.start=180,
observation.window.duration=365,
carry.only.for.same.medication = TRUE);
## End(Not run)