ciAssessment {Rariant} | R Documentation |
Functions to compute the coverage probability of a confidence interval method.
coverageProbability(pars, fun = acCi, n_sample = 1e4, min_k, ...)
pars |
Data frame with parameter combinations [data.frame] |
n_sample |
Number of assessments per parameter combination [integer(1)]. |
fun |
CI function |
min_k |
Minimum 'k2' value to use. |
... |
Additional arguments that are passed on to 'fun'. |
The 'data.frame' object 'pars' with additional columns 'cp' for the coverage probability and 'aw' average confidence interval width.
Fagerland, Morten W., Stian Lydersen, and Petter Laake. Recommended Confidence Intervals for Two Independent Binomial Proportions. Statistical Methods in Medical Research (2011).
## Define parameter space pars = expand.grid(k1 = 1:5, k2 = 5, n1 = 30, n2 = 30) conf_level = 0.95 ## Compute coverage probabilities cp = coverageProbability(pars, fun = acCi, n_sample = 1e2, conf_level = conf_level) print(cp)