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

View source: R/stats_extensions.R

normal_intervalR Documentation

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

Description

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

Usage

normal_interval(.data, mean, std_dev, conf = 0.95)

Arguments

.data

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

mean

Mean of the distribution

std_dev

Standard deviation of the distribution

conf

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

See Also

Other interval verbs: beta_interval()

Examples

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

# apply the default confidence interval of 0.95
normal_interval(example, mean, std_dev)

# apply a custom confidence interval
normal_interval(example, mean, std_dev, conf = 0.99)

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