pnpos: Probability of n positive observations, corrected for...

Description Usage Arguments Details TODO

View source: R/pnetfn.R

Description

Compute the probability that we observe n positive test results, given a population prevalence, total population size, and sensitivity and specificity for the test.

Usage

1
pnpos(k, p, npos, Npop, phi, eta)

Arguments

k

Sample size

p

Population prevalence

npos

Target number of positive observations

Npop

Total population

phi

Test sensitivity

eta

Test specificity

Details

The probability of observing X positive results is given by the probability mass function for the hypergeometric distribution, ρ_H, which is calculated with dhyper. The correction for test errors is calculated with pnetfn. You get n positives if there were m positives in your sample, and the net false negatives were equal to m-n. Therefore,

P(X = n) = ∑_{i=0}^{k} ρ_H(i, M, N-M, k) * P(NFN=i-n).

We allow the user to specify an arbitrary population prevalence; it will be rounded to integer population counts.

TODO

This function should really be called dnpos


rplzzz/sampEstimator documentation built on May 24, 2020, 4:35 a.m.