CMA0 {AdhereR} | R Documentation |
CMA0 constructor.
Description
Constructs a basic CMA (continuous multiple-interval measures of medication availability/gaps) object.
Usage
CMA0(
data = NULL,
ID.colname = NA,
event.date.colname = NA,
event.duration.colname = NA,
event.daily.dose.colname = NA,
medication.class.colname = NA,
medication.groups = NULL,
flatten.medication.groups = FALSE,
medication.groups.colname = ".MED_GROUP_ID",
carryover.within.obs.window = NA,
carryover.into.obs.window = 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.start.per.medication.group = FALSE,
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 = "Base CMA object",
suppress.warnings = FALSE,
suppress.special.argument.checks = FALSE,
arguments.that.should.not.be.defined = NULL,
...
)
Arguments
data |
A |
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
|
medication.groups |
A vector of characters defining medication
groups or the name of a column in |
flatten.medication.groups |
Logical, if |
medication.groups.colname |
a string (defaults to ".MED_GROUP_ID")
giving the name of the column storing the group name when
|
carryover.within.obs.window |
Logical, if |
carryover.into.obs.window |
Logical, if |
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.start.per.medication.group |
a logical: if there are
medication groups defined and this is |
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). |
date.format |
A string giving the format of the dates used in
the |
summary |
Metadata as a string, briefly describing this CMA. |
suppress.warnings |
Logical, if |
suppress.special.argument.checks |
Logical parameter for internal
use; if |
arguments.that.should.not.be.defined |
a list of argument names and pre-defined valuesfor which a warning should be thrown if passed to the function. |
... |
other possible parameters |
Details
In most cases this should not be done directly by the user, but it is used internally by the other CMAs.
Value
An S3
object of class CMA0
with the following fields:
-
data
The actual event (prescribing or dispensing) data, as given by thedata
parameter. -
ID.colname
the name of the column indata
containing the unique patient ID, as given by theID.colname
parameter. -
event.date.colname
the name of the column indata
containing the start date of the event (in the format given in thedate.format
parameter), as given by theevent.date.colname
parameter. -
event.duration.colname
the name of the column indata
containing the event duration (in days), as given by theevent.duration.colname
parameter. -
event.daily.dose.colname
the name of the column indata
containing the prescribed daily dose, as given by theevent.daily.dose.colname
parameter. -
medication.class.colname
the name of the column indata
containing the classes/types/groups of medication, as given by themedication.class.colname
parameter. -
carryover.within.obs.window
whether to consider the carry-over within the observation window, as given by thecarryover.within.obs.window
parameter. -
carryover.into.obs.window
whether to consider the carry-over from before the starting date of the observation window, as given by thecarryover.into.obs.window
parameter. -
carry.only.for.same.medication
whether the carry-over applies only across medication of the same type, as given by thecarry.only.for.same.medication
parameter. -
consider.dosage.change
whether the carry-over is adjusted to reflect changes in dosage, as given by theconsider.dosage.change
parameter. -
followup.window.start
the beginning of the follow-up window, as given by thefollowup.window.start
parameter. -
followup.window.start.unit
the time unit of thefollowup.window.start
, as given by thefollowup.window.start.unit
parameter. -
followup.window.duration
the duration of the follow-up window, as given by thefollowup.window.duration
parameter. -
followup.window.duration.unit
the time unit of thefollowup.window.duration
, as given by thefollowup.window.duration.unit
parameter. -
observation.window.start
the beginning of the observation window, as given by theobservation.window.start
parameter. -
observation.window.start.unit
the time unit of theobservation.window.start
, as given by theobservation.window.start.unit
parameter. -
observation.window.duration
the duration of the observation window, as given by theobservation.window.duration
parameter. -
observation.window.duration.unit
the time unit of theobservation.window.duration
, as given by theobservation.window.duration.unit
parameter. -
date.format
the format of the dates, as given by thedate.format
parameter. -
summary
the metadata, as given by thesummary
parameter.
Examples
cma0 <- CMA0(data=med.events,
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,
followup.window.start.unit="days",
followup.window.duration=2*365,
followup.window.duration.unit="days",
observation.window.start=30,
observation.window.start.unit="days",
observation.window.duration=365,
observation.window.duration.unit="days",
date.format="%m/%d/%Y",
summary="Base CMA");