ci_p_score_cc | R Documentation |
This function calculates the score confidence interval with continuity correction for a Binomial proportion. It is vectorized, allowing the evaluation of single values or vectors.
ci_p_score_cc(x, n, conf.level = 0.95)
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, it is 0.95. |
The score confidence interval with continuity correction is an
adjusted interval for the Binomial proportion p
.
The mathematical definitions are as follows:
Lower limit: \frac{2np + z^2 - 1 - z \sqrt{z^2 - 2 - \frac{1}{n} + 4p(nq + 1)}}{2n + 2z^2}
.
Upper limit: \frac{2np + z^2 + 1 + z \sqrt{z^2 + 2 - \frac{1}{n} + 4p(nq - 1)}}{2n + 2z^2}
.
Where p = x / n
is the sample proportion, q = 1 - p
its complement, and z
is the critical value of the standard normal distribution.
The limits are truncated to the range [0, 1]
.
A vector with the lower and upper limits.
Omar David Mercado Turizo, omercado@unal.edu.co
Missing reference.
ci_p.
# Example with a single value
ci_p_score_cc(x = 15, n = 50, conf.level = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.