sim.ci.mean | R Documentation |
Performs a computer simulation of the confidence interval performance for a population mean. Sample data can be generated from five different population distributions. All distributions are scaled to have standard deviations of 1.0.
sim.ci.mean(alpha, n, dist, rep)
alpha |
alpha level for 1-alpha confidence |
n |
sample size |
dist |
type of distribution (1, 2, 3, 4,or 5)
|
rep |
number of Monte Carlo samples |
Returns a 1-row matrix. The columns are:
Coverage - probability of confidence interval including population mean
Lower Error - probability of lower limit greater than population mean
Upper Error - probability of upper limit less than population mean
Ave CI Width - average confidence interval width
sim.ci.mean(.05, 40, 4, 1000)
# Should return (within sampling error):
# Coverage Lower Error Upper Error Ave CI Width
# 0.94722 0.01738 0.0354 0.6333067
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.