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 set number of days of a patient-specific follow-up start date
1 2 3 4 | new_users_var(df, df2, drug, timeframe = 0, return_all = TRUE,
patient_id_col = "patient_id", drug_id_col = "drug_id",
presc_date_col = "presc_date_x", ev_date_col = "ev_date_1",
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 |
df2 |
a data frame containing dates to be used as patient specific start dates - needs to contain at least patient IDs and event dates |
drug |
a string containing a drug ID to be used to limit the prescribing data to the drug(s) of interest, accepts regular expressions |
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 |
ev_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 3 4 | new_users_var(synth_presc, df2 = synth_events,
drug = "SIMVASTATIN", timeframe = 90,
presc_date_col = "presc_date", drug_id_col = "approved_name",
ev_date_col = "start_date")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.