ci_p_coverage: Coverage for interval confidence p

View source: R/ci_p_coverage.R

ci_p_coverageR Documentation

Coverage for interval confidence p

Description

This function calculates the true coverage for any interval confidence for p.

Usage

ci_p_coverage(n, p, conf.level = 0.95, intervalType = "wald")

Arguments

n

number of trials.

p

true value for p.

conf.level

nominal confidence level for the returned confidence interval. By default is 0.95.

intervalType

type of confidence interval, possible choices are listed in ci_p.

Details

This function was inspired by the binomTestCoveragePlot() function from conf package and Park & Leemis (2019).

Value

A dataframe with Method, n, p and true coverage.

Author(s)

David Esteban Cartagena Mejía, dcartagena@unal.edu.co

References

Park, H., & Leemis, L. M. (2019). Ensemble confidence intervals for binomial proportions. Statistics in Medicine, 38(18), 3460-3475.

See Also

ci_p.

Examples

ci_p_coverage(n=10, p=0.45, intervalType="wald")
ci_p_coverage(n=10, p=0.45, intervalType="wilson")
ci_p_coverage(n=10, p=c(0.10, 0.25, 0.40), intervalType="wilson")


fhernanb/stests documentation built on March 29, 2025, 10:36 a.m.