Learn R Programming

mStats (version 3.2.2)

scoreCI: Calculate confidence intervals by the Wilson Score method

Description

scoreCI() generates confidence intervals by the Wilson Score method

ciCollapse formats two values in this format (##.# - ##.#).

Usage

scoreCI(p, n, z = 1.96, correct = FALSE)

ciCollapse(ci, sep = " - ", rnd = 2, bracket = TRUE)

Arguments

p

proportion

n

sample size

z

confidence level

correct

a logical indicating whether to apply continuity correction

ci

a vector of two values (lower and upper CI values)

sep

separator for line break

rnd

specify rounding of numbers. See round.

bracket

a logical indicating whether to paste bracket to ci values

Details

scoreCI

The Wilson score interval is an improvement over the normal approximation interval in that the actual coverage probability is closer to the nominal value. It was developed by Edwin Bidwell Wilson (1927). (Wikipedia)

Reference:

  1. Brown, Lawrence D.; Cai, T. Tony; DasGupta, Anirban (2001). "Interval Estimation for a Binomial Proportion". Statistical Science. 16 (2): 101<U+2013>133.

  2. Wallis, Sean A. (2013). "Binomial confidence intervals and contingency tests: mathematical fundamentals and the evaluation of alternative methods" .Journal of Quantitative Linguistics. 20 (3): 178<U+2013>208.

  3. Newcombe, R. G. (1998). "Two-sided confidence intervals for the single proportion: comparison of seven methods". Statistics in Medicine. 17 (8): 857<U+2013>872. doi:10.1002/(SICI)1097-0258(19980430)17:8<857::AID-SIM777>3.0.CO;2-E. PMID 9595616.

See Also

diagTest

Examples

Run this code
# NOT RUN {
scoreCI(.20, 200)
scoreCI(.20, 200, correct = TRUE)

# }

Run the code above in your browser using DataLab