powered by
This function takes some parameters and simulates random samples and their confidence intervals
OurConf(samples = 100, n = 30, mu = 0, sigma = 1, conf.level = 0.95)
The number of times to draw random samples
The sample size we draw each time
The population mean mu
The population standard deviation
What confidence level to compute 1 - alpha (significance level)
A ggplot2 object
stats::qnorm, stats::rnorm, BSDA::CIsim
stats::qnorm
stats::rnorm
BSDA::CIsim
# NOT RUN { OurConf(samples = 100, n = 30, mu = 0, sigma = 1, conf.level = 0.95) OurConf(samples = 2, n = 5) OurConf(samples = 25, n = 25, mu = 100, sigma = 20, conf.level = 0.99) # }
Run the code above in your browser using DataLab