View source: R/ci_p_coverage.R
ci_p_coverage_plot | R Documentation |
This function plots the coverage for any confidence interval for p.
ci_p_coverage_plot(
n,
conf.level = 0.95,
intervalType = "wald",
plot = TRUE,
seq_p = seq(from = 0.01, to = 0.99, length.out = 50),
col = "deepskyblue2",
linecolor = "tomato",
...
)
n |
number of trials. |
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. |
plot |
logical value to obtain the plot, TRUE by default. |
seq_p |
sequence for the values of |
col |
color for the coverage curve. |
linecolor |
color for the line representing the conf.level. |
... |
further arguments and graphical parameters passed to plot function. |
This function was inspired by the binomTestCoveragePlot() function from conf package and Park & Leemis (2019).
A dataframe with Method, n, p and true coverage and the plot.
David Esteban Cartagena Mejía, dcartagena@unal.edu.co
Park, H., & Leemis, L. M. (2019). Ensemble confidence intervals for binomial proportions. Statistics in Medicine, 38(18), 3460-3475.
ci_p.
ci_p_coverage_plot(n=10,
intervalType="wald",
conf.level=0.95,
ylim=c(0.8, 1), las=1)
ci_p_coverage_plot(n=10,
intervalType="clopper_pearson",
conf.level=0.95,
ylim=c(0.9, 1), las=1)
ci_p_coverage_plot(n=10,
intervalType="wilson",
conf.level=0.95,
ylim=c(0.9, 1), las=1)
ci_p_coverage_plot(n=10,
intervalType="jeffreys",
conf.level=0.95,
ylim=c(0.9, 1), las=1)
ci_p_coverage_plot(n=10,
intervalType="agresti_coull",
conf.level=0.95,
ylim=c(0.9, 1), las=1)
ci_p_coverage_plot(n=10,
intervalType="arcsine",
conf.level=0.95,
ylim=c(0.9, 1), las=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.