Estimates apparent prevalence and confidence limits for
given sample size and result, assuming representative sampling
Usage
ap(x, n, type = "wilson", conf = 0.95)
Arguments
x
number of positives in sample
n
sample size, note: either x or n can be a vector,
but at least one must be scalar
type
method for estimating CI, one of c("normal", "exact", "wilson", "jeffreys", "agresti-coull", "all"),
default = "wilson"
conf
level of confidence required, default = 0.95 (scalar)
Value
either 1) if type = "all", a list with 5 elements, each element
a matrix with 6 columns, x, n, proportion, lower confidence limit,
upper confidence limit, confidence level and CI method; or
2) a matrix of results for the chosen method
# NOT RUN {# examples for ap functionn<- 200x<- 25conf<- 0.95ap(x, n)
ap(seq(10, 100, 10), 200, type = "agresti")
ap(seq(10, 100, 10), 200, type = "all")
# }