Skip to contents

Calculate the confidence interval

Usage

confidence_interval(.vector, .interval = 0.95)

Arguments

.vector

A numeric vector of data points

.interval

A numeric value representing the confidence level (e.g., 0.95 for 95% confidence interval) The default is 0.95

Value

A named vector with the lower and upper bounds of the confidence interval

Details

This function calculates the confidence interval for a given vector and interval.

Author

Steven P. Sanderson II, MPH

Examples

confidence_interval(rnorm(100), 0.95)
#> # A tibble: 1 × 2
#>    lower  upper
#>    <dbl>  <dbl>
#> 1 -0.360 0.0672