ci.pv | R Documentation |
Computes adjusted Wald confidence intervals for positive and negative predictive values (PPV and NPV) of a diagnostic test with retrospective sampling where the population prevalence rate is assumed to be known. With retrospective sampling, one random sample is obtained from a subpopulation that is known to have a "positive" outcome, a second random sample is obtained from a subpopulation that is known to have a "negative" outcome, and then the diagnostic test (scored "pass" or "fail") is given in each sample. PPV and NPV can be expressed as a function of proportion ratios and the known population prevalence rate (the population proportion who would "pass"). The confidence intervals for PPV and NPV are based on the Price-Bonett adjusted Wald confidence interval for a proportion ratio.
ci.pv(alpha, f1, f2, n1, n2, prev)
alpha |
alpha level for 1-alpha confidence |
f1 |
number of participants with a positive outcome who pass the test |
f2 |
number of participants with a negative outcome who fail the test |
n1 |
sample size for the positive outcome group |
n2 |
sample size for the negative outcome group |
prev |
known population proportion with a positive outcome |
Returns a 2-row matrix. The columns are:
Estimate - adjusted estimate of the predictive value
LL - lower limit of the adjusted Wald confidence interval
UL - upper limit of the adjusted Wald confidence interval
Price2008statpsych
ci.pv(.05, 89, 5, 100, 100, .16)
# Should return:
# Estimate LL UL
# PPV: 0.7640449 0.5838940 0.8819671
# NPV: 0.9779978 0.9623406 0.9872318
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.