Description Usage Arguments Details Value Author(s) See Also Examples
Confidence intervals calculated from simulated data are stored in a data frame that allows further processing (including plotting).
1 2 3 4 5 6 7 8 9 10 | CIsim(n, samples = 100, rdist = rnorm, args = list(),
estimand = 0, conf.level = 0.95,
method = t.test, method.args = list(),
interval = function(x) {
do.call(method, c(list(x, conf.level = conf.level), method.args))$conf.int
},
estimate = function(x) {
do.call(method, c(list(x, conf.level = conf.level), method.args))$estimate
},
verbose = TRUE)
|
n |
sample size |
samples |
number of samples to simulate |
rdist |
random distribution function for generating random samples; defaults to |
args |
arguments for |
estimand |
value of estimand |
conf.level |
level of confidence |
method |
function for computing a confidence interval and point estimate from data.
|
method.args |
additional arguments for |
interval |
a function for computing a confidence interval from data |
estimate |
a function for computing the point estimate from data |
verbose |
should a report of percentage of simulated intervals that cover the estimand be printed to the screen? |
This function is design for flexibility and ease of use rather than for efficiency.
The goal is to make it easy to estimate coverage rates for a wide range of
confidence intervals and population distributions. The resulting data frame
stores data in a manner suitable for plotting with xYplot()
(see examples).
A data frame with one row per sample and variables
estimate
(point estimate),
lower
(lower bound of confidence interval),
upper
(upper bound of confidence interval),
cover
(boolean indicating if estimand is in the interval), and
sample
(a counter, primarily useful for plotting)
Randall Pruim
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.