Learn R Programming

MKmisc (version 1.9)

normCI: Confidence Intervals for Mean and Standard Deviation

Description

This function can be used to compute confidence intervals for mean and standard deviation of a normal distribution.

Usage

normCI(x, mean = NULL, sd = NULL, conf.level = 0.95, na.rm = TRUE)

Value

A list with class "confint" containing the following components:

estimate

the estimated mean and sd.

conf.int

confidence interval(s) for mean and/or sd.

Infos

additional information.

Arguments

x

vector of observations.

mean

mean if known otherwise NULL.

sd

standard deviation if known otherwise NULL.

conf.level

confidence level.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Author

Matthias Kohl Matthias.Kohl@stamats.de

Details

The standard confidence intervals for mean and standard deviation are computed that can be found in many textbooks, e.g. Chapter 4 in Altman et al. (2000).

References

D. Altman, D. Machin, T. Bryant, M. Gardner (eds). Statistics with Confidence: Confidence Intervals and Statistical Guidelines, 2nd edition 2000.

Examples

Run this code
x <- rnorm(50)
## mean and sd unknown
normCI(x)
## sd known
normCI(x, sd = 1)
## mean known
normCI(x, mean = 0)

Run the code above in your browser using DataLab