pooledBinDiff: Confidence intervals for the difference of proportions

Description Usage Arguments Details Value Author(s) References Examples

View source: R/pooledBinDiff.R

Description

The function calculates confidence intervals for the difference of two proportions based on pooled testing experiments containing various different pool sizes.

Usage

1
2
3
4
pooledBinDiff(x1, m1, x2, m2, n1 = rep(1, length(x1)),
 n2 = rep(1, length(x2)), pt.method = c("bc-mle", "mle", "mir"), 
 ci.method = c("skew-score", "bc-skew-score", "score", "lrt", "wald", "mir"),
 scale = 1, alpha = 0.05, tol = .Machine$double.eps^0.5)

Arguments

x1

a vector, specifying the observed number of positive pools, among the number of pools tested (n1) in population 1

m1

a vector of corresponding pool sizes in population 1, must have the same length as x1

x2

a vector, specifying the observed number of positive pools, among the number of pools tested (n2) in population 2

m2

a vector of corresponding pool sizes in population 2, must have the same length as x2

n1

a vector of the corresponding number of pools with sizes m1

n2

a vector of the corresponding number of pools with sizes m2

pt.method

a character string, specifying the point estimate to compute, with the following options: "bc-mle" bias-corrected MLE, the default; "mle" MLE, and "mir" MIR.

ci.method

a character string, specifying the confidence interval to compute, with options: "skew-score" skewness-corrected, the default, "score" the score, "bc-skew-score" bias- and skewness-corrected "lrt" likelihood ratio test. Further, the options "wald" wald and "mir" MIR are available but are recommended.

scale

a single numeric, coefficient to scale the point estimates and intervals bounds in the print and summary method (print.poolbindiff, summary.poolbindiff)

alpha

a single numeric, specifying the type-I-error level

tol

accuracy required for iterations in internal functions

Details

Note, that the methods "mir" and "wald" can not be recommended, because they return too narrow intervals in relevant situations, "mir" because it ignores the pooling, and "wald" because it relies on simple large sample methods. For computational details and simulation results of the remaining methods, see Biggerstaff (2008).

Value

A list with elements

d

the estimated difference of proportions

lcl

the lower confidence limit

ucl

the upper confidence limit

pt.method

the method used for point estimation

ci.method

the method used for interval estimation

alpha

the type-I-error level

scale

Scaling coefficient for the output

x1

the numbers of postive pools in population 1

m1

the size of the pools in population 1

n1

the numbers of pools with corresponding pool sizes m1 in population 1

x2

the numbers of postive pools in population 2

m2

the size of the pools in population 2

n2

the numbers of pools with corresponding pool sizes m1 in population 2

Author(s)

Brad Biggerstaff

References

Biggerstaff BJ (2008): Confidence interval for the difference of proportions estmimated from pooled samples. Journal of Agricultural Biological and Environmental Statistics 2008, 13(4):478-496.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Consider an imaginary example, where pools of size
# 1, 5, 10 and 50 are tested, 5 pools of each size. The same 
# design is applied to estimate the prevalence in
# two populations: 
# In population 1, among the 5 pools with size 1 and 5,
# no positive pool is observed,
# while among the 5 pools of size 10 and 50, 1 and 2 positive
# pools are identified, respectively.
 
# In population 2, 1 positive result is observed
# among the 5 pools each pooling 5 elements,
# no positive result among the pools pooling 10 elements,
# 4 positive results among the pools pooling 50 elements,

x1 <- c(0,0,1,2)
m <- c(1,5,10,50)
n <- c(5,5,5,5)

x2<-c(0,1,0,4)

pooledBinDiff(x1=x1, m1=m, x2=x2, m2=m, n1=n, n2=n)

summary(pooledBinDiff(x1=x1, m1=m, x2=x2, m2= m, n1=n, n2=n), scale=1000)

# Compare recommended methods:

pooledBinDiff(x1=x1, m1=m, x2=x2, m2= m, n1=n, n2=n, pt.method="mle",
 ci.method="lrt")

pooledBinDiff(x1=x1, m1=m, x2=x2, m2= m, n1=n, n2=n, pt.method="mle",
 ci.method="score") 

pooledBinDiff(x1=x1, m1=m, x2=x2, m2= m, n1=n, n2=n, pt.method="mle",
 ci.method="skew-score")
  

binGroup documentation built on May 30, 2017, 5:35 a.m.