Skip to contents

Plot the observed delays of a dataset

Usage

# S3 method for class 'epidist_linelist_data'
plot_delays(
  x,
  by = NULL,
  binwidth = 1,
  delay_min = NULL,
  reference = NULL,
  family = "lognormal",
  ...
)

Arguments

x

An epidist_linelist_data or epidist_aggregate_data object, a named list of them to compare, or a model fitted with epidist().

by

A string naming a column of x to stratify the delays by.

binwidth

The width of the delay bins, on the scale of the event times. Defaults to 1, the daily censoring the data usually has.

delay_min

The minimum delay to mark with a dashed vertical line, as a number on the scale of the event times. If NULL, the default, the delay_min column of x is used when it has one and no line is drawn otherwise.

reference

A named numeric vector of the distributional parameters of a delay distribution to draw over the columns, as c(mu = 1.8, sigma = 0.5) for a lognormal delay. If NULL, the default, no distribution is drawn.

family

A brms family, or the name of one, giving the delay distribution reference holds the parameters of. Defaults to "lognormal".

...

Passed to the method.

Value

A ggplot object.