View source: R/multiple.ci.sim.R
multiple.ci.sim | R Documentation |
Simulation to illustrate the effect that confidence level and sample size have on the results of confidence interval width and correctness.
multiple.ci.sim( sample.sizes = c(30, 120), confidence.levels = c(0.8, 0.95), mu = 100, sigma = 10, number.simulations = 100, scale = 2.5 )
sample.sizes |
A vector of sample sizes. Length 2 is recommended. Default is sample.sizes=c(30, 120) |
confidence.levels |
A vector of confidence levels. Length 2 is recommended. Default is confidence.levels=c(0.8, 0.95) |
mu |
Mean of the distribution from which samples are taken (default is 100) |
sigma |
Standard deviation of the distribution from which samples are taken (default is 10). |
number.simulations |
Number of confidence intervals to be simulated (default is 100). |
scale |
Scale factor that determines the scale of the common y-axis of the plots. The default is 2. A larger number would allow more white space around edges. A smaller number might allow some of the interval endpoints to be outside of the plots. |
If the lengths of sample.sizes and confidence.levels are both 2, the output is in the form of a 2 x 2 factorial that shows the effect that sample size and confidence level have on the width and probability of correctness of a sequence of prediction intervals. Each time the function is executed, different simulated data sets led to different sets of confidence inervals to be plotted.
multiple.ci.sim() multiple.ci.sim(sample.sizes = c(10, 40)) multiple.ci.sim(confidence.levels = c(0.95, 0.99)) multiple.ci.sim(sample.sizes = c(10, 40), confidence.levels = c(0.95, 0.99))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.