Learn R Programming

arkhe (version 1.10.0)

confidence_mean: Confidence Interval for a Mean

Description

Computes a confidence interval for a mean at a desired level of significance.

Usage

confidence_mean(object, ...)

# S4 method for numeric confidence_mean(object, level = 0.95, type = c("student", "normal"))

Value

A length-two numeric vector giving the lower and upper confidence limits.

Arguments

object

A numeric vector.

...

Currently not used.

level

A length-one numeric vector giving the confidence level. Must be a single number between \(0\) and \(1\).

type

A character string giving the type of confidence interval to be returned. It must be one "student" (the default) or "normal". Any unambiguous substring can be given.

Author

N. Frerebeau

See Also

Other summary statistics: confidence_binomial(), confidence_multinomial(), interval_credible(), interval_hdr()

Examples

Run this code
## Confidence interval for a mean
x <- seq(from = -4, to = 4, by = 0.01)
y <- dnorm(x)

confidence_mean(y, type = "student")
confidence_mean(y, type = "normal")

## Confidence interval for a propotion
confidence_binomial(118, n = 236)

x <- c(35, 74, 22, 69)
confidence_multinomial(x)

Run the code above in your browser using DataLab