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.
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)
the population mean and standard deviation.
the available sample sizes (30
, 50
, 100
, 200
, 500
) for simulated data.
the available confidence levels (0.90
, 0.95
, 0.99
).
a logical parameter which determines whether interactive controls are provided or a simple static plot is produced.
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.
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.
Nothing is returned.
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).
rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.