AdhereR
from other programming languages and
platforms%>%
or |>
)-friendlyAdhereR
plots a posterioriEstimating the adherence to medications from electronic healthcare data (EHD) has been central to research and clinical practice across clinical conditions. For example, large retrospective database studies may estimate the prevalence of non-adherence in specific patient groups and model its potential predictors and impact on health outcomes, while clinicians may have access to individual patient records that flag up possible non-adherence for further clinical investigation and intervention. Yet, adherence measurement is a matter of controversy. Many methodological studies show that the same data can generate different prevalence estimates under different parametrisations (Greevy et al., 2011; Gardarsdottir et al., 2010; Souverein et al., in press; Vollmer et al., 2012; Van Wijk et al., 2006).
These parametrisation choices are usually not transparently reported in published empirical studies, and adherence algorithms are either developed ad-hoc or for proprietary software. This lack of transparency and standardization has been one of the main methodological barriers against the development of a solid evidence base on adherence from EHD, and may lead to misinformed clinical decisions.
Here we describe AdhereR
, an R package that aims to
facilitate the computing of adherence from EHD, as well as the
transparent reporting of the chosen calculations. It contains a set of
R
S3
classes and functions
that compute, summarize and plot various
estimates of adherence. A hypothetical dataset of medication events is
included for demonstration and testing purposes. In this vignette, we
start by defining the terms used in AdhereR
. We then use
medication records of two patients in the included dataset to illustrate
the various decisions required and their impact on estimates, starting
with the visualization of medication events, computation of persistence
(treatment episode length), and computation of adherence (9 functions
available in 3 versions: simple, per-treatment-episode, and
sliding-window). Visualizations for each function are illustrated, and
the interactive visualization function is presented.
While we tested the package relatively extensively, we cannot guarantee that bugs and errors do not exist, and we encourage the users to contact us with suggestions, bug reports, comments (or even just to share their experiences using the package) either by e-mail (to Dan ddediu@gmail.com or Alexandra alexadima@gmail.com) or using GitHub’s reporting mechanism at our repository https://github.com/ddediu/AdhereR, which contains the full source code of the package (including this vignette).
Adherence to medications is described as a process consisting of 3 successive elements/stages: initiation, implementation, and discontinuation (Vrijens et al., 2012). After initiating treatment (first medication intake), a patient would continue with implementing the regimen for a time period, ideally equal to the recommended time necessary for achieving therapeutic benefits; the quality of implementation is commonly labelled adherence and broadly operationalized as a ratio of medication quantity used versus prescribed in a time period. If patients discontinue medication earlier than the recommended time period, the period before discontinuation is described as persistence, in contrast to the following period of non-persistence.
The ideal measurement of this process would record the prescription moment and every medication intake with an exact time-stamp. This would allow, for example, to describe adherence to a twice-daily medication prescribed for 1 year in maximum detail: how long was the delay between prescription and the moment of the first medication intake, whether each of the two prescribed administrations per day corresponded to an intake event and at what time, how much medication was taken versus prescribed on any time interval while the patient persisted with treatment, any specific implementation patterns (e.g. missing or delaying the first daily dose), and when exactly the last medication intake event took place during that year. While this level of detail can be obtained by careful use of electronic monitoring devices, electronic healthcare data usually include much less information.
Administrative claims or pharmacy databases record medication dispensation events, including patient identifier, date of event, type of medication, and quantity dispensed, and less frequently daily dosage recommended. The same information may be available for prescription events in electronic medical records used in health care organizations (e.g primary care practices, secondary care centers). In between two dispensing or prescribing events, we don’t know whether and how medication has been used. What we do know is that, if taken as prescribed, the medication supplied at the first event would have lasted a number of days. If the time interval between the two events is longer than this number it is likely that the patient ran out of medication before re-supplying or used less during that time. If the interval is substantially longer or there is no second event, then the patient has probably finished the supply at some point and then discontinued medication. Thus, EHD-based algorithms estimate medication adherence and persistence based on the availability of current supply, under four main assumptions:
(Several other assumptions apply to individual algorithms, and will be discussed later.)
AdhereR
was developed to compute adherence and
persistence estimates from EHD based on the principles described above.
The current version is based on a single data source, therefore an
algorithm for initiation (time interval between first prescription and
first dispensing event) is not implemented (it is a time difference
calculation easy to implement in with basic R functions). The following
terms and definitions are used:
AdhereR
requires a dataset of medication events over a
FUW of sufficient length in relation to the recommended treatment
duration. To our knowledge, no research has been performed to date on
the relationship between FUW length and recommended treatment duration.
AdhereR
offers the opportunity for answering such
methodological questions, but we would hypothesize that the FUW duration
also depends on the duration of medication events (shorter durations
would allow shorter FUW windows to be informative).
The minimum necessary dataset includes 3 variables for each
medication event: patient unique identifier, event
date, and duration. Daily dosage and
medication type are optional.AdhereR
is thus
designed to use datasets that have already been extracted from EHD and
prepared for calculation. These preliminary steps depend to a large
extent on the specific database used and the type of medication and
research design. Several general guidelines can be consulted (Arnet et al., 2016; Peterson et al., 2007), as well as
database-specific documentation. In essence, these steps should
entail:
For demonstration purposes, we included in AdhereR
a
hypothetical dataset of 1080 medication events from 100 patients in a
2-year FUW. Five variables are included in this dataset:
PATIENT_ID
),DATE
; from 6 July 2030 to 3 September 2044,
in the “mm/dd/yyyy” format),PERDAY
; median 4, range 2-20 doses per
day),CATEGORY
; 50.8% medA and 49.2% medB),
andDURATION
; median 50, range 20-150 days).Table 1 shows the medication events of two
example patients: 19 medication events related to two medication types
(medA
and medB
). They were selected to
represent two different medication histories. Patient 37
had a stable daily dosage but event duration changes with medication
change. Patient 76
had a more variable pattern, including
medication, daily dosage and duration changes.
# Load the AdhereR library:
library(AdhereR);
# Select the two patients with IDs 37 and 76 from the built-in dataset "med.events":
<- med.events[med.events$PATIENT_ID %in% c(37, 76), ];
ExamplePats # Display them as pretty markdown table:
::kable(ExamplePats, caption = "<a name=\"Table-1\"></a>**Table 1.** Medication events for two example patients"); knitr
A first step towards deciding which algorithm is appropriate for
these data is to explore medication histories visually. We do this by
creating an object of type CMA0
for the two example
patients, and plotting it. This type of plots can of course be created
for a much bigger subsample of patients and saved as as a
JPEG
, PNG
, TIFF
, EPS
or PDF
file using R
’s plotting system for data
exploration.
# Create an object "cma0" of the most basic CMA type, "CMA0":
<- CMA0(data=ExamplePats, # use the two selected patients
cma0 ID.colname="PATIENT_ID", # the name of the column containing the IDs
event.date.colname="DATE", # the name of the column containing the event date
event.duration.colname="DURATION", # the name of the column containing the duration
event.daily.dose.colname="PERDAY", # the name of the column containing the dosage
medication.class.colname="CATEGORY", # the name of the column containing the category
followup.window.start=0, # FUW start in days since earliest event
observation.window.start=182, # OW start in days since earliest event
observation.window.duration=365, # OW duration in days
date.format="%m/%d/%Y"); # date format (mm/dd/yyyy)
# Plot the object (CMA0 shows the actual event data only):
plot(cma0, # the object to plot
align.all.patients=TRUE); # align all patients for easier comparison
We can see that patient 76
had an interruption of more
than 100 days between the second and third medB
supply and
several situations of new supply acquired while the previous supply was
not exhausted. Patient 37
had shorter gaps between
consecutive events, but very little overlap in supplies. For patient
76
, the switch to medB
happened while the
medA
supply was still available, then a switch back to
medA
happened later, at the end of the second year. For
patient 37
, there was a single medication switch (to
medB
) without an overlap at that point.
Sometimes it is useful to also see the daily dose:
# Same plot as above but also showing the daily doses:
plot(cma0, # the object to plot
print.dose=TRUE, plot.dose=TRUE,
align.all.patients=TRUE); # align all patients for easier comparison
These observations highlight several decision points in calculating persistence and adherence, which need to be informed by the clinical context of the study:
76
an
indication of non-persistence, or of lower adherence over that time
interval? If the medication is likely to be used rarely despite daily
use recommendations, such an interval might indicate a period of low
adherence. If usual adherence rates are close to 100% when used, that
delay is likely to indicate a treatment gap and needs to be treated as
such, and the last 2 events as reinitiation of treatment (new treatment
episode);medA
to medB
an
indicator of a new treatment episode? If medA
and
medB
are two alternative formulations of the same chemical
molecule, there might be clinical arguments for considering them as part
of the same treatment episode (e.g. the pharmacist provided an
alternative option to a product unavailable at the moment). If they are
two distinct drug classes with different mechanisms of action and
recommendations of use, it may be more appropriate to consider that
patient 76
has had 3 treatment episodes and patient
37
one episode;37
this seems to matter very little, as
there is little overlap between event durations, but patient
76
has substantial overlaps. If available medication is not
likely to be either overused or discarded at every new medication event,
it is important to control for carry-over;76
has changed from medA
to
medB
while still having a large supply of medA
available. Was the patient more likely to discard the remaining
medA
the moment of receiving medB
or finish it
before starting the medB
supply? If they are two
alternative formulations and medB
was (for example) given
because medA
was not in stock at the moment, probably this
came with a recommendation to finish the available supply. If they are
two distinct drug classes and the switch happens usually after
assessment of therapeutic versus side effects, probably this came with a
recommendation to stop using medA
.These decisions therefore need to be taken based on a good understanding of the pharmacological properties of the medication studied, and the most plausible clinical decision-making in routine care. This information can be collected from an advisory committee with relevant expertise (e.g. based on consensus protocols), or (even better) qualitative or survey research on the routine practices in prescribing, dispensing and using that specific medication. Of course, this is not always possible – a second-best option (or even complementary option, if consensus is not reached) is to compare systematically the effects of different analysis choices on the hypotheses tested (e.g. as sensitivity analyses).
An essential first decision is to distinguish between persistence
with treatment and quality of implementation (once the patient started
treatment – which, as explained above, is assumed in situations when we
have only one data source of prescribing or dispensing events). The
function compute.treatment.episodes()
was developed for
this purpose. We provide below an example of how this function can be
used.
Let’s imagine that medA
and medB
are two
different types of medication, and clinicians in our advisory committee
agree that whenever a health care professional changes the type of
medication supplied this should be considered as a new treatment
episode; we will specify this as setting the parameter
medication.change.means.new.treatment.episode
to
TRUE
.
They also agree that a minumum of 6 months (180 days) need to pass
after the end of a medication supply (taken as prescribed) without
receiving a new supply in order to be reasonably confident that the
patient has discontinued/interrupted the treatment – they can conclude
this for example based on an approximate calculation considering that
specific medication is usually supplied for 1-2 months, daily dosage is
usually 2 to 4 pills a day, and patients often use as low as 1/4 of the
recommended dose in a given interval. We will specify this as
maximum.permissible.gap = 180
, and
maximum.permissible.gap.unit = "days"
. (If in another
scenario the clinical information we obtain suggests that the
permissible gap should depend on the duration of the last supply, for
example 6 times that interval should go by before a discontinuation
becoming likely, we can specify this as
maximum.permissible.gap = 600
, and
maximum.permissible.gap.unit = "percent"
.)
We might also have some clinical confirmation that usually people
finish existing supply before starting the new one
(carryover.within.obs.window = TRUE
), but of course only
for the same medication if medA
and medB
are
supplied with a recommendation to start a new treatment immediately
(carry.only.for.same.medication = TRUE
), take the existing
supply based on the new dosage recommendations if these change
(consider.dosage.change = TRUE
).
The rest of the parameters specify the name of the dataset (here
ExamplePats
), names of the variables in the dataset (here
based on the demo dataset, described above), and the FUW (here the whole
2-year window).
# Compute the treatment episodes for the two patients:
<- compute.treatment.episodes(ExamplePats,
TEs3ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carryover.within.obs.window = TRUE, # carry-over into the OW
carry.only.for.same.medication = TRUE, # & only for same type
consider.dosage.change = TRUE, # dosage change starts new episode...
medication.change.means.new.treatment.episode = TRUE, # & type change
maximum.permissible.gap = 180, # & a gap longer than 180 days
maximum.permissible.gap.unit = "days", # unit for the above (days)
followup.window.start = 0, # 2-years FUW starts at earliest event
followup.window.start.unit = "days",
followup.window.duration = 365 * 2,
followup.window.duration.unit = "days",
date.format = "%m/%d/%Y");
::kable(TEs3,
knitrcaption = "<a name=\"Table-2\"></a>**Table 2.** Example output `compute.treatment.episodes()` function");
The function produces a dataset as the one shown in Table 2. It includes each treatment episode for each
patient (here 2 episodes for patient 37
and 3 for patient
76
) and records the patient ID, episode number, date of
episode start, gap days at the end of or after the treatment episode,
duration of episode, and episode end date:
Notes:
In some scenarios, it is important to imagine that the episodes also
include the maximum permissible gap when the gap is
larger than this maximum (i.e., not when a new episode is due to a
change in treatment or dose before this maximum permissible gap was
exceeded). To allow such scenarios,
compute.treatment.episodes()
has a logical parameter,
maximum.permissible.gap.append.to.episode
, which, when set
to TRUE
appends the maximum permissible gap at the end of
the episodes (its default value FALSE
means that the
episodes end as described above).
This output can be used on its own to study causes and consequences
of medication persistence (e.g. by using episode duration in
time-to-event analyses). This function is also a basis for the
CMA_per_episode
class, which is described later in the
vignette.
Let’s consider another scenario: medA
and
medB
are alternative formulations of the same chemical
molecule, and clinicians agree that they can be used by patients within
the same treatment episode. In this case, both patients had a single
treatment episode for the whole duration of the follow-up (Table 3). We can therefore compute adherence for any
observation window (OW) within these 2 years without any concern that we
might confuse quality of implementation with (non-)persistence.
# Compute the treatment episodes for the two patients
# but now a change in medication type does not start a new episode:
<- compute.treatment.episodes(ExamplePats,
TEs4ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carryover.within.obs.window = TRUE,
carry.only.for.same.medication = TRUE,
consider.dosage.change = TRUE,
medication.change.means.new.treatment.episode = FALSE, # here
maximum.permissible.gap = 180,
maximum.permissible.gap.unit = "days",
followup.window.start = 0,
followup.window.start.unit = "days",
followup.window.duration = 365 * 2,
followup.window.duration.unit = "days",
date.format = "%m/%d/%Y");
# Pretty print the events:
::kable(TEs4,
knitrcaption = "<a name=\"Table-3\"></a>**Table 3.** Alternative scenario output `compute.treatment.episodes()` function");
Once we clarified that we indeed measure quality of implementation
and not (non)-persistence, several CMA
classes can be used
to compute this specific component of adherence. We will discuss first
in turn the simple CMA
classes, then present the
more complex (or iterated) CMA_per_episode
and
CMA_sliding_window
ones.
A first decision to consider when calculating the quality of
implementation is what is the appropriate observation window – when it
should start and how long it should last? We can see for example that
patient 76
had some periods of regular (even overlapping)
supplies, and periods when there were some large delays between
consecutive medication events. Thus, estimating adherence for a whole
2-year period might be too coarse-grained to mean anything for how
patients actually managed their treatment at any particular moment. As
mentioned earlier in the Definitions
section, EHD don’t have good granularity to start with, so we need
to do the best with what we’ve got – and compressing all this
information into a single estimate might not be the best solution, at
least not the obvious first choice. On the other hand, due to the low
granularity, we cannot target very short observation windows either
because we simply don’t know what happened every day. This decision
needs to be informed again by information collected from the advisory
committee or qualitative/quantitative studies in the target population.
It also needs to take into account the average duration of medication
supply from one event, and the average time interval between two events
– which can be examined in exploratory plots (Figure
1) – and the research question and design of the study. For example,
if we expect that the quality of implementation reduces in time from the
start of a treatment episode, medication is usually supplied for one
month, and patients can take up to 4 times as much to use up their
supplies, we might want to consider comparing successive 4-month OWs. If
we want to examine quality of implementation 6 months before a clinical
event (on the clinical assumption that how a patient takes medication in
previous 6 months may impact on the probability of a health event
occurring or not), we might want to consider an OW start 6 months before
the event, and a 6-month duration. The posibilities here are endless,
and research on the impact of different analysis choices on substantive
results is still scarce. When the consensus is not reached based on the
available information, one or more parametrisations can be compared –
and formulated as research questions.
For demonstration purposes, let’s imagine a scenario when an
adherence intervention takes place 6 months (182 days) after the start
of the treatment episode, and we hypothesize that it will improve the
quality of implementation in the next year (365 days) in the
intervention group compared to the control group. We can specify this as
followup.window.start=0
,
observation.window.start=182
, and
observation.window.duration=365
(we can of course divide
this interval into shorter windows and compare the two groups in terms
of longitudinal changes in adherence, as we shall see later, but for the
moment let’s stick to a global 1-year estimate). We have 9 CMA classes
that can produce very different estimates of the quality of
implementation, the first eight have been described by Vollmer and colleagues (2012) as applied to
randomized controlled trials. We implemented them in
AdhereR
based on the authors’ description, and in essence
are defined by 4 parameters:
CMA1 is the simplest method, often described in the
literature as the medication possession ratio (MPR). It simply
adds up the duration of all medication events within the OW, excluding
the last event, and divides this by the number of days between the first
and last event (multiplied by 100 to obtain a percentage). Thus, it can
be higher than 1 (or 100% adherence) and, if the OW does not start and
end with a medication event for all patients, it can actually refer to
different lengths of time within the OW for different patients. For
example, for patient 76
below CMA1 is computed for the
period starting with the first event in the highlighted interval and
ending at the date if the last event – thus, it considers only 4 events
with considerable overlaps and results in a CMA1 of 140%, indicating
overuse.
Creating an object of class CMA1
with various parameters
automatically performs the estimation of CMA1 for all the patients in
the dataset; moreover, the object is smart enough to allow the
appropriate printing and plotting. The object includes all the parameter
values with which it was created, as well as the CMA
data.frame
, which is the main result, with two columns:
patient ID and the corresponding CMA estimate. The CMA estimates appear
as ratios, but can be trivially transformed into percentages and
rounded, as we did for patient 76
below (rounded to 2
decimals). The plots show the CMA as percentage rounded to 1
decimal.
# Create the CMA1 object with the given parameters:
<- CMA1(data=ExamplePats,
cma1 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
# Display the summary:
cma1
## CMA1:
## "The ratio of days with medication available in the observation window excluding the last event; durations of all events added up and divided by number of days from first to last event, possibly resulting in a value >1.0"
## [
## ID.colname = PATIENT_ID
## event.date.colname = DATE
## event.duration.colname = DURATION
## medication.groups = <NONE>
## flatten.medication.groups = FALSE
## medication.groups.colname = .MED_GROUP_ID
## followup.window.start = 0
## followup.window.start.unit = days
## followup.window.start.per.medication.group = FALSE
## followup.window.duration = 730
## followup.window.duration.unit = days
## observation.window.start = 182
## observation.window.start.unit = days
## observation.window.duration = 365
## observation.window.duration.unit = days
## date.format = %m/%d/%Y
## CMA = CMA results for 2 patients
## ]
## DATA: 19 (rows) x 5 (columns) [2 patients].
# Display the estimated CMA table:
$CMA cma1
## PATIENT_ID CMA
## 1 37 0.4035874
## 2 76 1.4000000
# and equivalently using an accessor function:
getCMA(cma1);
## PATIENT_ID CMA
## 1 37 0.4035874
## 2 76 1.4000000
# Compute the CMA value for patient 76, as percentage rounded at 2 digits:
round(cma1$CMA[cma1$CMA$PATIENT_ID== 76, 2]*100, 2)
## [1] 140
# Plot the CMA:
# The legend shows the actual duration, the days covered and gap days,
# the drug (medication) type, the FUW and OW, and the estimated CMA.
plot(cma1,
patients.to.plot=c("76"), # plot only patient 76
legend.x=520); # place the legend in a nice way
Thus, CMA1 assumes that there is a treatment episode within the OW
(shorter or equal to the OW) when the patient used the medication, and
every new medication event happened when the previous supply finished
(possibly due to overuse). These assumptions rarely fit with real life
use patterns. One limitation is not considering the last event – which
represents almost a half of the OW in the case of patient
76
.
To address this limitation, CMA2 includes the duration of the last event in the numerator and the period from the last event to the end of the OW in the denominator. Thus, the estimate Figure 3 is 77.9%, more in line with the medication history of this patient in the year after the intervention.
<- CMA2(data=ExamplePats, # we're estimating CMA2 now!
cma2 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma2,
patients.to.plot=c("76"),
show.legend=FALSE); # don't show legend to avoid clutter (see above)
Both CMA1 and CMA2 can be higher that 1 (100% adherence) based on the assumption that medication supply is finished until the last event (CMA1) or the end of the OW (CMA2). But sometimes this is not plausible, because patients can refill their supply earlier (for example when going on holidays) and overuse is a less frequent behaviour for some medications (when side effects are considerable for overuse, or medications are expensive). Or it may be that it does not matter whether patients use 100% or more that 100% of their medication, the therapeutic effect is the same with no risks or side effects. Again, this is a matter of inquiry to the advisory committee or investigation in the target population.
If it is likely that implementation does not exceed 100% (or does not make a difference if it does), CMA3 and CMA4 below adjust for this by capping CMA1 and CMA2 respectively to 100%. As shown in Figures 4 and 5, CMA3 is now capped at 100%, and CMA4 remains the same as CMA2 (because it was already lower than 100%).
<- CMA3(data=ExamplePats, # we're estimating CMA3 now!
cma3 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma3, patients.to.plot=c("76"), show.legend=FALSE);
<- CMA4(data=ExamplePats, # we're estimating CMA4 now!
cma4 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma4,patients.to.plot=c("76"), show.legend=FALSE);
All CMAs from 1 to 4 have a major limitation: they don’t take into account the timing of the events. But if there is a large gap between two events it is more likely that the person had used the medication less than prescribed at least in part of that interval. Just capping the values as in CMA3 and CMA4 does not account for that likely reduction in adherence – two patients with the same quantity of supply will have the same percentage of adherence even if one has had substantial delays in supply at some points and the other supplied in time.
To adjust for this, CMA5 and CMA6 provide
alternative calculations to CMA1 and CMA2 respectively. Thus, we instead
calculate the number of gap days, extract it from the total time
interval, and divide this value by the total time interval (first to
last event in CMA5, and first event to end of OW in CMA6). By
considering the gaps, we now need to decide whether to control for how
any remaining supply is used when a new supply is obtained. Two
additional parameters are included here:
carry.only.for.same.medication
and
consider.dosage.change
. Both are set here as
FALSE
, to specify the fact that carry over should always
happen irrespective of what medication is supplied, and that the
duration of the remaining supply should be modified if the dosage
recommendations are changed with a new medication event. As shown in Figures 6 and 7, these
alternative calculations do not make any difference for patient
76
, because there are no gaps between the 5 events in the
OW highighted. There could be, however, situations in which large gaps
between some events in the OW result in lower CMA estimates when
considering timing of events.
<- CMA5(data=ExamplePats, # we're estimating CMA5 now!
cma5 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carry.only.for.same.medication=FALSE, # carry-over across medication types
consider.dosage.change=FALSE, # don't consider canges in dosage
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma5,patients.to.plot=c("76"), show.legend=FALSE);
<- CMA6(data=ExamplePats, # we're estimating CMA6 now!
cma6 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carry.only.for.same.medication=FALSE,
consider.dosage.change=FALSE,
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma6,patients.to.plot=c("76"), show.legend=FALSE);
Sometimes it is useful to also see the daily dose:
# Same plot as above but also showing the daily doses:
plot(cma6, # the object to plot
patients.to.plot=c("76"), # plot only patient 76
print.dose=TRUE, plot.dose=TRUE,
legend.x=520); # place the legend in a nice way
All CMAs so far have another limitation: they do not consider the interval between the start of the OW and the first event within the OW. For situations in which the OW start coincides with the treatment episode start, this limitation has no consequences. But in scenarios like ours (OW starts during the episode) this has two major drowbacks. First, the time interval for calculating CMA is not the same for all patients; this can result in biases, for example if the intervention group tends to refill sooner after the intervention moment than the control group, the control group might seem more adherent but it is because CMA is calculated on a shorter time interval within the following year. And second, if there is any medication supply left from before the OW start, this is not considered (so CMA may be underestimated).
CMA7 addresses this limitation by extending the nominator to the whole OW interval, and by considering carry over both from before and within the OW. The same paremeters are available to specify whether this depends on the type of medication and considers dosage changes (applied now to both types of carry over). Figure 8 shows how considering the period at the OW start and the prior supply reduces CMA7 to 69%, due to the gap visible in the medication history plot between the event before the OW and the first event within the OW.
<- CMA7(data=ExamplePats, # we're estimating CMA7 now!
cma7 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carry.only.for.same.medication=FALSE,
consider.dosage.change=FALSE,
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma7, patients.to.plot=c("76"), show.legend=FALSE);
When entering a randomized controlled trial involving a new
medication, a patient on ongoing treatment may be more likely to finish
the current supply before starting the trial medication. In these
situations, it may be more appropriate to consider a lagged start of the
OW (even if this results in a different denominator for trial
participants). Let’s consider this different scenario for patient
76
: at day 374, a new treatment (medB
) starts
and we need to estimate CMA for the next 294 days (until the next
medication change). But there is still some medA
left, so
it is likely that the patient finished this first. Figure 9 shows how the OW is shortened with the
number of days it would have taken to finish the remaining
medA
(assuming use as prescribed); CMA8 is quite
low 36.1%, given the long gaps between medB events. In a future version,
it might be interesting to implement the possibility to also move the
end of OW so that its length is preserved.
<- CMA8(data=ExamplePats, # we're estimating CMA8 now!
cma8 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carry.only.for.same.medication=FALSE,
consider.dosage.change=FALSE,
followup.window.start=0, observation.window.start=374,
observation.window.duration=294,
date.format="%m/%d/%Y");
plot(cma8, patients.to.plot=c("76"), show.legend=FALSE);
# The value for patient 76, rounded at 2 digits
round(cma8$CMA[cma8$CMA$PATIENT_ID== 76, 2]*100, 2);
## [1] 36.14
The previous 8 CMAs were described by Vollmer and colleagues (2012) in relation to randomized controlled trials, and may apply to many observational designs as well. However, they all rely on an assumption that might not hold for longitudinal cohort studies with multiple repeated measures: the medication is used as prescribed until current supply ends. In CMA7, this may introduce additional variation in adherence estimates depending on where the start of the OW is located relative to the last event before the OW and the first event within the OW: an OW start closer to the first event in the OW generates lower estimates for the same number of gap days between the two events. To address this, CMA9 first computes a ratio of days’ supply for each event in the FUW (until the next event or FUW end), then weighs all days in the OW by their corresponding ratio to generate an average CMA value for the OW.
For the same scenario as in CMA1 to CMA7, Figure 10 shows the estimate for CMA9, which is higher than for CMA7 (70.6% versus 69%). This value would be the same no matter if the OW starts slightly earlier or later, because CMA9 considers the same intervals between events (the one starting before and the one ending after the OW). Thus, it depends less on the actual date when the OW starts.
<- CMA9(data=ExamplePats, # we're estimating CMA9 now!
cma9 ID.colname="PATIENT_ID",
event.date.colname="DATE",
event.duration.colname="DURATION",
event.daily.dose.colname="PERDAY",
medication.class.colname="CATEGORY",
carry.only.for.same.medication=FALSE,
consider.dosage.change=FALSE,
followup.window.start=0, observation.window.start=182,
observation.window.duration=365,
date.format="%m/%d/%Y");
plot(cma9, patients.to.plot=c("76"), show.legend=FALSE);