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 value determining whether an interactive panel is created or a static display is produced.

panel.plot

a logical parameter, relevant to the tcltk case only, which determines whether the plot is placed inside the panel (TRUE) or the standard graphics window (FALSE).

hscale, vscale

scaling parameters, relevant to the tcltk case only, for the size of the plot when panel.plot is set to TRUE. The default values are 1.

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

The tcltk panel object 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 March 12, 2026, 9:07 a.m.

Related to rp.ci in rpanel...