get_si {o2ools} | R Documentation |
Compute the serial interval (si) from transmission trees
Description
The serial interval is the time between the onset of symptoms in an infector-infectee pair. This function computes the serial interval statistics from a list of transmission trees.
Usage
get_si(
trees,
date_suffix = "date",
stats = list(mean = mean, lwr = function(x) quantile(x, 0.025, na.rm = TRUE), upr =
function(x) quantile(x, 0.975, na.rm = TRUE))
)
Arguments
trees |
A list of data frames, generated by |
date_suffix |
A string indicating the suffix for date of onset columns.
Default is "date", which means the columns should be named |
stats |
A list of functions to compute statistics. Default is:
Each function should take a numeric vector as input and return a single numeric value. |
Value
A data frame with serial interval statistic
See Also
get_trees
for generating a list of transmission trees.
Examples
trees <- get_trees(out, date = linelist$onset)
si_stats <- get_si(trees)
str(si_stats)