generic plot function for simaerep objects

# S3 method for simaerep
plot(
  x,
  ...,
  study = NULL,
  what = "ur",
  n_sites = 16,
  df_visit = NULL,
  env = parent.frame()
)

Arguments

x

simaerep object

...

additional parameters passed to plot_study() or plot_visit_med75()

study

character specifying study to be plotted, Default: NULL

what

one of c("ur", "med75"), specifying whether to plot site AE under-reporting or visit_med75 values, Default: 'ur'

n_sites

number of sites to plot, Default: 16

df_visit

optional, pass original visit data if it cannot be retrieved from parent environment, Default: NULL

env

optional, pass environment from which to retrieve original visit data, Default: parent.frame()

Value

ggplot object

Examples

# \donttest{
df_visit <- sim_test_data_study(
  n_pat = 100,
  n_sites = 5,
  frac_site_with_ur = 0.4,
  ur_rate = 0.6
)

df_visit$study_id <- "A"

aerep <- simaerep(df_visit)

plot(aerep, what = "ur", study = "A")

plot(aerep, what = "med75", study = "A")
#> purple line:          mean site ae of patients with visit_med75
#> grey line:            patient included
#> black dashed line:    patient excluded
#> dotted vertical line: visit_med75, 0.75 x median of maximum patient visits of site 
#> solid vertical line:  visit_med75 adjusted, increased to minimum maximum patient visit of included patients
#> dashed vertical line: maximum value for visit_med75 adjusted, 80% quantile of maximum patient visits of study
#> 

# }