medication_possession_ratio: Medication Possession Ratio (MPR)

Description Usage Arguments Value Examples

Description

medication_possession_ratio() returns a list of data frames.

Usage

1
2
medication_possession_ratio(x, date_var, pt_id_var, drug_var,
  day_supply_var, adherence_threshold = 80, measurement_year = 2018)

Arguments

x

a perscription claims database with only relvant claims for measurement (statins for statin adherence, etc.)

date_var

name of the fill date variable in the claims database (class POSIXlt or POSIXct)

pt_id_var

name of the ID variable for patients within claims database

drug_var

name of the variable housing drug names for each claim

day_supply_var

name of the Days Supply variable

adherence_threshold

threshold for patients meeting adherence criteria

measurement_year

year used to calculate MPR

Value

a list of 3 data tibbles with information regarding the adherence rate for your patient population

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
claim_frame <- tibble(
                         # Column of patient IDs
                     ID = c(rep("21", 5), rep("48", 3), rep("59", 8)),

                         # Column of dates (class: Date or POSIXct)
                     date = c(as.POSIXct(rep("2018-10-11",3), tz = "UTC"),
                       as.POSIXct("2018-11-11", tz = "UTC"),
                       as.POSIXct("2018-12-11", tz = "UTC"),
                       as.POSIXct(rep("2018-08-27", 2), tz = "UTC"),
                       as.POSIXct("2018-11-15", tz = "UTC"),
                       as.POSIXct(rep("2018-04-28", 5), tz = "UTC"),
                       as.POSIXct(rep("2018-12-25", 3), tz = "UTC")),

                       # Column of days supply from claim
                     days_supply = c(30, 30, 60, 90, 30, 30, 60, 15, 30, 30, 60, 90, 30, 30, 30, 90),

                         # Preferentially would have the drug's NDC here
                         # to avoid formatting issues with characters strings
                     drug = c("x", "x", "y", "y", "y", "x", "y", "x", "x", "x", "x", "y", "y", "x", "x", "y")
                     )
                                  # note that these names should not be in quotations!
medication_possession_ratio(x = claim_frame,
                          date_var = date,
                          pt_id_var = ID,
                          drug_var = drug,
                          day_supply_var = days_supply,
                          adherence_threshold = 80,
                          measurement_year = 2018)

btbeal/adheRenceRX documentation built on June 5, 2019, 11:02 a.m.