Learn R Programming

berryFunctions (version 1.11.0)

cie: Extended confidence interval

Description

As in ci,calculates the confidence interval around mean using t.test, but also returns mean, sd, CV (Coefficient of Variation), 2 given Quantiles, min and max

Usage

cie(dat, lev = 0.95, digits = 3, p1 = 0.05, p2 = 0.95)

Arguments

dat
vector with the data to use.
lev
numeric. confidence level. DEFAULT: 0.95
digits
integer. Number of digits rounded to in output. DEFAULT: 3
p1
numeric. lower percentile passed to quantile. DEFAULT: 0.05
p2
numeric. upper percentile passed to quantile. DEFAULT: 0.95

Value

A dataframe with the lower and upper confidence interval, as well as the level used, and mean, sd, CV (Coefficient of Variation), 2 given Quantiles, min and max

See Also

ci, t.test, summary

Examples

Run this code

yourdata <- c(5:8,3,14)
cie(yourdata)          # confidence interval with the default confidence level (95%)
cie(yourdata, lev=0.99)# specified with a different confidence level 
cie(yourdata, 0.99, 4) # returns 4 decimal places
cie(yourdata, digits=2)# rounds to 2 decimal places with default level
cie                    # shows the function itself

Run the code above in your browser using DataLab