p.conf
calculates confidence intervals for the binomial paramter p (probability of success) using raw or summarized data. By default Wilson point estimators are used to estimate $p$ and $\sigma_{\hat{p}}$. If raw data are to be used (the default) then successes should be indicated as ones and failures as zeroes in the data
vector. Finite population corrections can also be specified. Three methods for confidence intervals can be implemented: the normal approximation, Wilson estimators (Wilson 1927), i.e. the adjusted Wald method, and the Clopper-Pearson exact method (Clopper and Pearson 1934). Agresti and Coull (1998) reccomend the Wilson estimation method.ci.p(data, conf = 0.95, summarized = FALSE, phat = NULL, S.phat = NULL,
fpc = FALSE, n = NULL, N = NULL, method="wilson")
summarized = FALSE
.summarized = TRUE
.summarized = TRUE
.fpc = TRUE
then N
must be specified. Finite population corrections are not possible for method = "exact"
summarized = TRUE
.fpc = TRUE
.method ="wilson"
is the default, although there are two other options, method="approximation"
provides the conventional normal approximation. methode="exact"
class = "ci"
. Default printed results are the paramter estimate and confidence bounds. Other objects are invisible
. In particular, if method = "wilson" or "approximation"
returns a list with four items:method = "wilson"
the function returns the confidence interval, ci
, only, i.e. no other invsible
components exist.ci.mu.z
, ci.p
#In 2001, it was estimated that 56,200 Americans would be diagnosed with non-Hodgkin's lymphoma and that 26,300 would die from it (Cernan et al. 2002). Here we find the 95% confidence interval for the probability of diagnosis \emph{p}.
ci.p(c(rep(0, 56200-26300),rep(1,26300)))
Run the code above in your browser using DataLab