Learn R Programming

binomSamSize (version 0.1-3)

poolbinom.logit: Calculate logit based confidence interval for binomial proportion for pooled samples

Description

Calculate logit based confidence interval for the the Bernoulli proportion of $k\cdot n$ individuals, which are pooled into $n$ pools each of size $k$. Observed is the number of positive pools $x$.

Usage

poolbinom.wald(x, k, n, conf.level=0.95)
poolbinom.logit(x, k, n, conf.level=0.95)

Arguments

x
Number of positive pools (can be a vector).
k
Pool size (can be a vector).
n
Number of pools (can be a vector).
conf.level
The level of confidence to be used in the confidence interval

Value

  • A data.frame containing the observed proportions and the lower and upper bounds of the confidence interval. The style is similar to the binom.confint function of the binom package

Details

Assume the individual probability of experiencing the event for each of $k\cdot n$ individuals is $\pi$, i.e. the response is Bernoulli distributed $X_i \sim B(\pi)$. For example $\pi$ could be the prevalence of a disease in veterinary epidemiology.

Now, instead of considering each individual the $k\cdot n$ samples are pooled into $n$ pools each of size $k$. A pool is positive if there is at least one positive in the pool. Let X be the number of positive pools. Then $$X \sim Bin(n, 1-(1-\pi)^k)$$.

The present function computes an estimator and confidence interval for $\pi$ by computing the MLE and standard error for $\hat{\pi}$. A Wald confidence interval is formed using $\hat{\pi} \pm z_{1-\alpha/2}\cdot se(\hat{\pi})$. In case of poolbinom.logit a logit transformation is used, i.e. the standard error for $logit(\hat{\pi})$ is computed and the Wald-CI is derived on the logit-scale which is then backtransformed using the inverse logit function. In case $x=0$ or $x=n$ the logit of $\hat{\pi}$ is not defined and hence the confidence interval is not defined in these two situation. To fix the problem we use the intervals $(0, \hat{\pi}_u(x=0))$ and $(\hat{\pi}_l(x=n),1)$, respectively, where $\pi_u$ and $\pi_o$ are the respective borders of a corresponding LRT interval.

The poolbinom.wald approach corresponds to method 2 in the Cowling et al. (1999). The logit transformation improves on this procedure, because the method ensures that the interval is in the range (0,1).

References

D. W. Cowling, I. A. Gardner, W. O. Johnson (1999), Comparison of methods for estimation of individual level prevalence based on pooled samples, Preventive Veterinary Medicine, 39:211--225

See Also

poolbinom.lrt

Examples

Run this code
poolbinom.wald(x=0, k=10, n=34, conf.level=0.95)
poolbinom.logit(x=0:1, k=10, n=34, conf.level=0.95)
poolbinom.logit(x=1, k=seq(10,100,by=10), n=34, conf.level=0.95)
poolbinom.logit(x=0:34,k=1,n=34)

Run the code above in your browser using DataLab