presc_per_patient: Prescriptions Per Patient Summary Statistics

Description Usage Arguments Value Examples

View source: R/summaries.R

Description

Calculates the mean, median, minimum and maximum numbers of prescriptions per patient within the data - either for all drugs, or for those matching the specified ID

Usage

1
2
presc_per_patient(df, drug = ".", patient_id_col = "patient_id",
  drug_id_col = "drug_id")

Arguments

df

a data frame containing prescribing records to be analysed - records must contain at least a drug identifier

drug

a string corresponding to a drug identifier to be matched

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

Value

a dat aframe containing the mean, median, minimum and maximum number of prescriptions per patient

Examples

1
2
presc_per_patient(synth_presc, drug_id_col = "approved_name")
presc_per_patient(synth_presc, drug = "SIMVASTATIN", drug_id_col = "approved_name")

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