CI: Confidence Interval of Mean

Description Usage Arguments Value Examples

View source: R/CI.R

Description

Calculate the confidence interval or limits of the mean using the t distribution.

Usage

1
CI(x, alpha = 0.05, keepMean = TRUE, limits = TRUE, prefix = "", na.rm = FALSE)

Arguments

x

Numeric vector of sample observations.

alpha

Numeric scalar denoting significance level, default 0.05.

keepMean

Logical scalar indicating if the mean should be returned with the confidence interval/limits, default TRUE.

limits

Logical scalar indicating if the limits should be returned (otherwise a single interval is returned), default TRUE.

prefix

Character scalar to be used in assigning names to the returned value, default "".

na.rm

Logical scalar indicating if missing values should be removed before calculations, default FALSE.

Value

A named vector of the mean (if keepMean=TRUE) and the (1 - alpha)*100 interval (if limits=FALSE). Names are the prefix concatenated to "mean", "lo", and "hi".

Examples

1
CI(1:10)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.