zcii: zcii

Usage Arguments Examples

View source: R/zcii.R

Usage

1
zcii(n, a, conf.level = 0.95, ci = T, verbose = F)

Arguments

n
a
conf.level
ci
verbose

Examples

 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
  }

gvdovandzung/thongke documentation built on May 23, 2020, 12:35 a.m.