Plot Estimated Delay Distributions

chronofix_plot_delays(
  samples,
  n_points = 200,
  facet_by_group = TRUE,
  share_x_axis = TRUE,
  select_group = NULL,
  select_delay = NULL,
  plot_style = c("ribbon", "spaghetti")
)

Arguments

samples

A chronofix_mcmc_samples object as generated by chronofix_mcmc().

n_points

Number of points along the x-axis to evaluate (default 200)

facet_by_group

Logical, if TRUE, creates a grid with a row per group (default TRUE)

share_x_axis

Logical, if TRUE, plots all distributions on the same x-axis scale (default TRUE). Note: the shared axis range is calculated over the filtered set of distributions, so a filtered plot may have a different maximum x-axis than an unfiltered plot.

select_group

Optional character vector. If provided, only plots delays matching this group (e.g., "hospitalised-alive"). Supports multiple groups.

select_delay

Optional character vector. If provided, only plots delays matching this label (e.g., "onset to hospitalisation"). Supports multiple delays.

plot_style

Character string. Options are "ribbon" (plots a ribbon indicating the 95% credible interval, default), or "spaghetti" (plots a line for each individual posterior draw).