Description Usage Arguments Details Value Author(s) References Examples
Computes confidence intervals for negative and positive predictive values by simulation from the posterior beta-distribution (Stamey and Holt, 2010), assuming a case-control design to estimate sensitivity and specificity, while prevalence estimates of an external study and/or prior knowledge concerning prevalence may be introduced additionally.
1 2 3 4 5 6 7 |
x1 |
A vector of two (integer) values, specifying the observed number of positive ( |
x0 |
A vector of two (integer) values, specifying the observed number of positive ( |
pr |
A single numeric value between 0 and 1, defining an assumed fixed (known) prevalence (for |
xpr |
An optional vector of two (integer) values, specifying the observed number of positive ( |
conf.level |
The confidence level, a single numeric value between 0 and 1, defaults to 0.95 |
alternative |
A character string specifying whether two-sided ( |
B |
A single integer, the number of samples from the posterior to be drawn. |
shapes1 |
Two positive numbers, the shape parameters (a,b) of the beta prior for the sensitivity, by default a flat beta prior (a=1, b=1) is used. |
shapes0 |
Two positive numbers, the shape parameters (a,b) of the beta prior for (1-specificity), by default a flat beta prior (a=1, b=1) is used. Note, that this definition differs from that in Stamey and Holt(2010), where the prior is defined for the specificity directly. |
shapespr |
Two positive numbers, the shape parameters (a,b) of the beta prior for the prevalence, by default a flat beta prior (a=1, b=1) is used. For |
... |
Arguments to be passed to |
CIpvBI
implements the method refered to as Bayes I in Stamey and Holt (2010), CIpvBI
implements the method refered to as Bayes II in Stamey and Holt (2010), Equation (2) and following description (p. 103-104).
A list with elements
conf.int |
the confidence bounds |
estimate |
the point estimate |
tab |
a 2x2 matrix showing how the input data in terms of true positives and true negatives |
Frank Schaarschmidt
Stamey JD and Holt MM (2010). Bayesian interval estimation for predictive values for case-control studies. Communications in Statistics - Simulation and Computation. 39:1, 101-110.
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 | # example data: Stamey and Holt, Table 8 (page 108)
# Diseased
# Test D=1 D=0
# T=1 240 87
# T=0 178 288
#n1,n0: 418 375
# reproduce the results for the Bayes I method
# in Stamey and Holt (2010), Table 9, page 108
# assuming known prevalence 0.03
# ppv 0.0591, 0.0860
# npv 0.9810, 0.9850
CIpvBI( x1=c(240,178), x0=c(87,288), pr=0.03)
# assuming known prevalence 0.04
# ppv 0.0779, 0.1111
# npv 0.9745, 0.9800
CIpvBI( x1=c(240,178), x0=c(87,288), pr=0.04)
# compare with standard logit intervals
tab <- cbind( x1=c(240,178), x0=c(87,288))
tab
BDtest(tab, pr=0.03)
BDtest(tab, pr=0.04)
# reproduce the results for the Bayes II method
# in Stamey and Holt (2010), Table 9, page 108
CIpvBII( x1=c(240,178), x0=c(87,288), shapespr=c(16,486))
CIpvBII( x1=c(240,178), x0=c(87,288), shapespr=c(21,481))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.