ci_p: Confidence intervals for Binomial proportions

View source: R/ci_p.R

ci_pR Documentation

Confidence intervals for Binomial proportions

Description

This function obtains the confidence interval for a proportion.

Usage

ci_p(x, n, conf.level = 0.95, intervalType = "wald")

Arguments

x

a number or a vector with the number of successes.

n

a number or a vector with the number of trials.

conf.level

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

intervalType

type of confidence interval, possible choices are: "wald", "agresti_coull", "rindskopf", "clopper_pearson", "add_4", "arcsine_cc", "arcsine", "arcsine_ac", "wilson", "ci_p_jeffreys", "hpd_jeffreys", "LRT", "mid_p", "agresti_caffo", "score_cc", "wald_cc", "wald_recentered", "wald_recentered_cc",

Value

A dataframe with the input information and the confidence interval.

Author(s)

Freddy Hernandez, fhernanb@unal.edu.co

See Also

ci_p_wald, ci_p_agresti_coull, ci_p_rindskopf, ci_p_clopper_pearson, ci_p_add_4, ci_p_arcsine_cc, ci_p_arcsine, ci_p_arcsine_ac, ci_p_wilson, ci_p_jeffreys, ci_p_hpd_jeffreys ci_p_mid_p, ci_p_agresti_caffo, ci_p_score_cc, ci_p_wald_cc, ci_p_wald_recentered, ci_p_wald_recentered_cc, ci_p_wald_t, ci_p_wald_bs

Examples

# Examples for alternative IC
ci_p(x=5, n=15, intervalType="wald", conf.level=0.90)
ci_p(x=5, n=15, intervalType="agresti_coull", conf.level=0.90)
ci_p(x=5, n=15, intervalType="rindskopf", conf.level=0.90)
ci_p(x=5, n=15, intervalType="clopper_pearson", conf.level=0.90)
ci_p(x=5, n=15, intervalType="arcsine_cc", conf.level=0.90)
ci_p(x=5, n=15, intervalType="arcsine", conf.level=0.90)

# Examples for multiple values
ci_p(x=c(5, 7, 9),
     n=c(15, 17, 19),
     intervalType="wald",
     conf.level=c(0.90, 0.95, 0.97))

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