Description Usage Arguments Value Examples
Function divides follow-up time into evenly sized windows of a user-defined length and defines patient exposure to the drug(s) of interest based on the presence or absence of prescriptions within the windows
1 2 3 4 5 | uat_windows(df, df2, drug, individual = FALSE, timeframe,
return_all = FALSE, patient_id_col = "patient_id",
drug_id_col = "drug_id", presc_date_col = "presc_date_x",
ev_date_1_col = "ev_date_1", ev_date_2_col = "ev_date_2",
date_format)
|
df |
a data frame containing prescribing records to be analysed - records must contain at least a patient ID, drug ID, prescription date |
df2 |
a data frame containing event data to be analysed, records must
contain at least two 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 |
individual |
logical - if TRUE prescriptions are split into windows based on individual values of ev_date_1 and ev_date_2. If FALSE, prescriptions are split into the same windows across all patients, based on the maximum value of ev_date_1 and the minimum value of ev_date_2 |
timeframe |
a number representing the desired length of each window in days |
return_all |
logical - if TRUE, all prescription windows are returned for all patients including windows where the patient did not have any prescriptions for the drug(s) of interest. If FALSE, only windows where patients had at least 1 prescription are returned |
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_1_col |
a string, the name of the column in |
ev_date_2_col |
a string, the name of the column in |
date_format |
a string, the format of the dates contained in |
A data frame containing a sequence of date groups for each patient and the number of prescriptions the patient had during each window; if return_all is TRUE a flag indicates windows during which the patient was exposed (exposed = 1) and unexposed (exposed = 0)
1 2 3 4 5 | uat_windows(df = synth_presc, df2 = synth_events, drug = "SIMVASTATIN",
individual = TRUE, timeframe = 90, return_all = TRUE,
patient_id_col = "patient_id", drug_id_col = "approved_name",
presc_date_col = "presc_date",
ev_date_1_col = "event_1", ev_date_2_col = "event_2", date_format = "%Y-%m-%d")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.