R/statpsych3.R
ci.pv.Rd
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 level for 1-alpha confidence
number of participants with a positive outcome who pass the test
number of participants with a negative outcome who fail the test
sample size for the positive outcome group
sample size for the negative outcome group
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
Price RM, Bonett DG (2008). “Confidence intervals for a ratio of two independent binomial proportions.” Statistics in Medicine, 27(26), 5497--5508. ISSN 02776715, doi:10.1002/sim.3376 .
ci.pv(.05, 89, 5, 100, 100, .16)
#> Estimate LL UL
#> PPV: 0.7640449 0.5838940 0.8819671
#> NPV: 0.9779978 0.9623406 0.9872318
# Should return:
# Estimate LL UL
# PPV: 0.7640449 0.5838940 0.8819671
# NPV: 0.9779978 0.9623406 0.9872318