Plot Outcome by Year-Quarter and Model
plot_outcome_by_quarter.RdCreates a boxplot of a specified outcome variable by year_quarter,
grouped and colored by model. This is useful for comparing outcomes
(e.g., overdose deaths) across different models over time.
Arguments
- plot_data
A data frame containing at least the columns
year_quarter, the specifiedoutcome, andmodel. Theyear_quartercolumn should be a factor or character indicating time periods, andmodelshould specify the model group.- outcome
A character string specifying the name of the outcome column in
plot_datato be plotted. Defaults to"PSS drug_deaths".