ci.sim {NCStats}R Documentation

Simulations of confidence intervals for a mean.

Description

This function draws a large number of random samples from a known normal distribution, computes a confidence interval for each sample, and plots the confidence intervals. The plot can be used to demonstrate the concept of confidence intervals. In addition, the number of samples and level of confidence can be adjusted to determine their effect of level of coverage and the interval width.

Usage

ci.sim(reps=100,method="z",mu=100,sigma=10)

Arguments

reps a numeric indicating the number of replicate samples to draw from the population.
method a string indicating whether to make confidence intervals using a normal (="z") or t (="t") distribution.
mu a numeric indicating the mean of the known normal distribution.
sigma a numeric indicating the standard deviation of the known normal distribution.

Value

None, but a dynamic graphic with slider bars will be produced.

Note

On first call a dialog box with three sliders will appear in the upper-left corner of the R window. A graphic will not be seen until an item in the dialog box is changed. At this time, the dialog box will appear to disappear. However, it has simply been minimized and can be reaccessed as all minimized programs are accessed. This “bug” only appears when the function is started and upon first change of an item in the dialog box.

Author(s)

Derek H. Ogle, dogle@northland.edu

Examples

## Not run by examples().  Copy and try in an interactive R session
## Not run: ci.sim()

[Package NCStats version 0.0-12 Index]