Produce a graphic representation of AE, counting AE as bars for each patient, colored by grade. Can be faceted by treatment arm.
ae_plot_grade_sum(
df_ae,
...,
df_enrol,
low = "#ffc425",
high = "#d11141",
weights = NULL,
arm = NULL,
grade = "AEGR",
subjid = "SUBJID"
)
adverse event dataset, one row per AE, containing subjid, soc, and grade.
unused
enrollment dataset, one row per patient, containing subjid (and arm if needed). All patients should be in this dataset.
the color of Grade 1 AE
the color of Grade 5 AE
(optional) a length 5 numeric vector, giving the weights of each grade
name of the treatment column in df_enrol
. Case-insensitive. Can be set to NULL
.
name of the AE grade column in df_ae
. Case-insensitive.
name of the patient ID in both df_ae
and df_enrol
. Case-insensitive.
a ggplot
ae_table_grade()
, ae_table_soc()
, ae_plot_grade()
, ae_plot_grade_sum()
, butterfly_plot()
tm = grstat_example()
attach(tm, warn.conflicts=FALSE)
ae_plot_grade_sum(df_ae=ae, df_enrol=enrolres)
ae_plot_grade_sum(df_ae=ae, df_enrol=enrolres, arm="ARM")
ae_plot_grade_sum(df_ae=ae, df_enrol=enrolres, arm="ARM", weights=c(1,1,3,6,10))