confInt: Calculate the X percent confidence interval

View source: R/gm_mean.R

confIntR Documentation

Calculate the X percent confidence interval

Description

confInt takes as input a numeric vector, the desired confidence interval, and returns the lower and upper values for the confidence interval. Note that, because calculating a confidence interval relies on an accurate estimate of the mean and standard deviation, your data should be normally distributed.

Usage

confInt(x, CI = 0.9, na.rm = TRUE, distribution_type = "t")

Arguments

x

A vector of numbers

CI

The confidence interval desired; default is 90 value as a decimal, e.g., 0.95.

na.rm

Should NA values be removed? (logical)

distribution_type

use a "t" distribution (default) or a "Z" distribution. Note: The Simcyp Simulator calculates geometric confidence intervals with a t distribution.

Examples

x <- rnorm(100, 5, 1)
confInt(x)
confInt(x, CI = 0.9)


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.