beta_interval: Apply a confidence interval to values in a dataframe based on...

View source: R/stats_extensions.R

beta_intervalR Documentation

Apply a confidence interval to values in a dataframe based on the beta distribution.

Description

Apply a confidence interval to values in a dataframe based on the beta distribution.

Usage

beta_interval(.data, alpha, beta, conf = 0.95)

Arguments

.data

Data frame; a confidence interval will be applied to each row in the data frame.

alpha

First shape parameter of the beta distribution, must be greater than 0

beta

Second shape parameter of the beta distribution, must be greater than 0

conf

Confidence interval, must be between ⁠[0, 1]⁠. Defaults to 0.95.

See Also

Other interval verbs: normal_interval()

Examples

# create example df
alpha <- rnorm(10, 100, 20)
beta <- rnorm(10, 80, 10)
example <- dplyr::bind_cols(alpha, beta)
colnames(example) <- c("alpha", "beta")

# apply the default confidence interval of 0.95
beta_interval(example, alpha, beta)

# apply a custom confidence interval
beta_interval(example, alpha, beta, conf = 0.99)

markjrieke/riekelib documentation built on Dec. 20, 2024, 4:57 a.m.