dd_sum: Calculate Cumulative Daily Dose

Description Usage Arguments Value Examples

View source: R/daily_dose.R

Description

Calculates the cumulative number of daily doses of a drug of interest dispensed for each patient. Results can be limited to only patients who have been prescribed more than a desired threshold number of daily doses.

Usage

1
2
3
dd_sum(df, drug, threshold = 1, patient_id_col = "patient_id",
  drug_id_col = "drug_id", presc_date_col = "presc_date_x",
  dd_disp_col = "dd_disp", date_format)

Arguments

df

a data frame containing prescribing records to be analysed - records must contain at least a paitent ID, drug ID, a prescription date and the number of daily doses disepnsed

drug

a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions

threshold

a number representing the minimum number of daily doses that must be present for the patient to be considered exposed

patient_id_col

a string, the name of the column in df containing the patient IDs

drug_id_col

a string, the name of the column in df containing the drug IDs

presc_date_col

a string, the name of the column in df containing the prescption date

dd_disp_col

a string, the name of the column in df containing the number of daily doses dispensed

date_format

a string, the format of the dates in df

Value

a data frame containing patient IDs and the corresponding number of prescriptions, number of daily doses dispensed and the date of the first prescription of the drug of interest

Examples

1
2
3
dd_sum(synth_presc, drug = "CITALOPRAM", threshold = 500,
drug_id_col = "approved_name", presc_date_col = "presc_date",
dd_disp_col = "ddd_dispensed", date_format = "%Y-%m-%d")

amarshall1/prescribeR documentation built on May 20, 2020, 2:34 p.m.