calc_CrI: Calculate Credible Interval

calc_CrIR Documentation

Calculate Credible Interval

Description

[Stable] Adds symmetric a credible interval based on quantiles.

Usage

calc_CrI(samples, summarise_by = NULL, CrI = 0.9)

Arguments

samples

A data.table containing at least a value variable

summarise_by

A character vector of variables to group by.

CrI

Numeric between 0 and 1. The credible interval for which to return values. Defaults to 0.9.

Value

A data.table containing the upper and lower bounds for the specified credible interval.

Examples

samples <- data.frame(value = 1:10, type = "car")
# add 90% credible interval
calc_CrI(samples)
# add 90% credible interval grouped by type
calc_CrI(samples, summarise_by = "type")

epiforecasts/EpiNow2 documentation built on Dec. 10, 2024, 5:32 p.m.