Learn R Programming

extras (version 0.10.0)

xtr_ci_eti: Equal-Tailed Interval

Description

Calculates Bayesian credible intervals using the equal-tailed interval (ETI), i.e., the CI such that the left and right tails outside the CI have the same coverage.

Usage

xtr_ci_eti(x, level = 0.95, ..., na_rm = FALSE)

Value

A data.frame of the lower and upper limits for the credible interval.

Arguments

x

A numeric vector of MCMC samples.

level

A number > 0 and <= 1 specifying the probability coverage of the interval.

...

Currently unused.

na_rm

A flag indicating whether to remove missing values.

Details

The interval is guaranteed to be two-sided, unlike [xtr_ci_hdi()]. Does not return integer outputs even if the input data are integers, unlike xtr_ci_hdi(). The interval limits are always real (double) numeric values.

See Also

xtr_ci() and xtr_ci_hdi()

Examples

Run this code
xtr_ci_eti(rnorm(1e4))

Run the code above in your browser using DataLab