Description Usage Arguments Value Examples
Classifies patients as new or ongoing users of the drug(s) of interest based on whether or not they have prescriptions within a lookback period based on a standardised start date for all patients
1 2 3 4 | new_users_fixed(df, drug, start_date = NULL, timeframe = 0,
return_all = TRUE, patient_id_col = "patient_id",
drug_id_col = "drug_id", presc_date_col = "presc_date_x",
date_format)
|
df |
a data frame containing prescription records to be analysed - records must contain at least a patient ID, drug ID and prescription date |
drug |
a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions |
start_date |
a string containing the date to start follow-up - any prescriptions before this date are used to indicate ongoing use |
timeframe |
a number representing the length, in days, of the timeframe before the start date to check for previous prescriptions |
return_all |
a logical, if TRUE the function will return data for all patients as well as flags indicating if they were exposed during follow-up and if they are new users. If FALSE, returns only new users exposed during follow-up |
patient_id_col |
a string, the name of the column in |
drug_id_col |
a string, the name of the column in |
presc_date_col |
a string, the name of the column in |
date_format |
a string, the format of the dates contained in |
A data frame containing patient IDs, flags indicating if the patient was a new user at the start date and if they were exposed during follow-up, and where applicable the date of the first prescription during follow-up
1 2 | new_users_fixed(synth_presc, drug = "SIMVASTATIN", start_date = "2021-01-01", timeframe = 90,
presc_date_col = "presc_date", drug_id_col = "approved_name")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.