Learn R Programming

Rariant (version 1.8.3)

ciAssessment: Assessment of CI methods

Description

Functions to compute the coverage probability of a confidence interval method.

Usage

coverageProbability(pars, fun = acCi, n_sample = 1e4, min_k, ...)

Arguments

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'.

Value

  • The 'data.frame' object 'pars' with additional columns 'cp' for the coverage probability and 'aw' average confidence interval width.

References

Fagerland, Morten W., Stian Lydersen, and Petter Laake. Recommended Confidence Intervals for Two Independent Binomial Proportions. Statistical Methods in Medical Research (2011).

Examples

Run this code
## 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)

Run the code above in your browser using DataLab