1 | zcii(n, a, conf.level = 0.95, ci = T, verbose = F)
|
n |
|
a |
|
conf.level |
|
ci |
|
verbose |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (n, a, conf.level = 0.95, ci = T, verbose = F)
{
N. <- 1 - ((1 - conf.level)/2)
b <- n - a
p <- a/n
a. <- ifelse(a == 0, a + 1, a)
b. <- ifelse(b == 0, b + 1, b)
low <- a./(a. + (b. + 1) * (1/qf(1 - N., 2 * a., 2 * b. +
2)))
up <- (a. + 1)/(a. + 1 + b./(1/qf(1 - N., 2 * b., 2 * a. +
2)))
low <- ifelse(a == 0, 0, low)
up <- ifelse(a == n, 1, up)
rval <- list(format(a/n, digits = 3), format(low, digits = 3),
format(up, digits = 3))
names(rval) <- c("est", "lower", "upper")
rval
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.