scoreCI()
generates confidence intervals by the
Wilson Score method
ciCollapse
formats two values in this format
(##.# - ##.#)
.
scoreCI(p, n, z = 1.96, correct = FALSE)ciCollapse(ci, sep = " - ", rnd = 2, bracket = TRUE)
proportion
sample size
confidence level
a logical indicating whether to apply continuity correction
a vector of two values (lower and upper CI values)
separator for line break
specify rounding of numbers. See round
.
a logical indicating whether to paste bracket to ci values
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:
Brown, Lawrence D.; Cai, T. Tony; DasGupta, Anirban (2001). "Interval Estimation for a Binomial Proportion". Statistical Science. 16 (2): 101<U+2013>133.
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.
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.
# NOT RUN {
scoreCI(.20, 200)
scoreCI(.20, 200, correct = TRUE)
# }
Run the code above in your browser using DataLab