Apparent prevalence

Description

Estimates apparent prevalence and confidence limits for given sample size and result, assuming representative sampling

Usage

1
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

Examples

1
2
3
4
5
6
7
# examples for ap function
n<- 200
x<- 25
conf<- 0.95
ap(x, n)
ap(seq(10, 100, 10), 200, type = "agresti")
ap(seq(10, 100, 10), 200, type = "all")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.