rp.ci: Simulations of normal-based confidence intervals

View source: R/rp-ci.r

rp.ciR Documentation

Simulations of normal-based confidence intervals

Description

This function shows simulated confidence intervals for the mean of a normal distribution. It also creates a panel which controls the mean and standard deviation of the population and the size of the simulated sample.

Usage

   rp.ci(mu = 0, sigma = 1, sample.sizes = c(30, 50, 100, 200, 500), confidence = 0.95,
         panel = TRUE, panel.plot = TRUE, hscale = NA, vscale = hscale)
  

Arguments

mu, sigma

the population mean and standard deviation.

sample.sizes

the available sample sizes (30, 50, 100, 200, 500) for simulated data.

confidence

the available confidence levels (0.90, 0.95, 0.99).

panel

a logical parameter which determines whether interactive controls are provided or a simple static plot is produced.

panel.plot

a logical parameter which determines whether the plot is placed inside the panel (TRUE) or the standard graphics window (FALSE). If the plot is to be placed inside the panel then the tkrplot library is required.

hscale, vscale

scaling parameters for the size of the plot when panel.plot is set to TRUE. The default values are 1 on Unix platforms and 1.4 on Windows platforms.

Details

A button is provided to sample repeatedly from the current settings. Confidence intervals which cover the population mean are coloured blue while those which miss are coloured red. Repeated simulations illustrate the property of confidence intervals to capture the true value with probability determined by the confidence level (which here is set to 0.95).

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

Examples

## Not run: 
  rp.ci()

## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.ci in rpanel...