Learn R Programming

distillery (version 1.2-1)

ci: Find Confidence Intervals

Description

Method function for finding confidence intervals.

Usage

ci(x, alpha = 0.05, ...)

# S3 method for matrix ci(x, alpha = 0.05, ...)

# S3 method for numeric ci(x, alpha = 0.05, ...)

# S3 method for ci print(x, ...)

Arguments

x

ci: an R object that has a ci method function for it.

print: output from ci.

alpha

number between zero and one giving the 1 - alpha confidence level.

Optional arguments depending on the specific method function. In the case of those for ci.matrix and ci.numeric, these are any optional arguments to mean and var.

Not used by print method function.

Value

ci.numeric: a numeric vector giving the CI bounds and mean value.

ci.matrix: a matrix giving the mean and CI bounds for each column of x.

Details

ci.numeric: Calculates the mean and normal approximation CIs for the mean.

ci.matrix: Does the same as ci.numeric, but applies to each column of x.

Examples

Run this code
# NOT RUN {
ci(rnorm(100, mean=10, sd=2))

ci(matrix(rnorm(10000, mean=40, sd=10), 100, 100))
# }

Run the code above in your browser using DataLab