confIntDemo: Confidence Interval Demonstration

Description Usage Arguments Details Value Author(s) Examples

View source: R/confIntDemo.R

Description

Draw many random samples and compute confidence interval. How many intervals capture the true mean?

Usage

1
confIntDemo(distr = "normal", size = 20, conf.level = 0.95)

Arguments

distr

distribution of the population to be sampled. Options include "normal", "exponential", "uniform" and "binary" (partial match allowed).

size

sample size

conf.level

confidence level.

Details

This simulation will draw 100 random samples from a given population distribution and compute the correpsonding confidence intervals. The 100 intervals will be drawn with an indication of the ones that missed the true mean. A histogram of the population will also be created.

Value

The command invisibly returns the fraction of intervals that capture the true mean.

Author(s)

Laura Chihara

Examples

1
2
3
confIntDemo()

confIntDemo(distr = "exponential", size = 40)

CarletonStats documentation built on May 29, 2017, 11:20 p.m.