Confidence intervals for positive and negative predictive values with retrospective sampling
Source:R/statpsych3.R
      ci.pv.RdComputes 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.
Arguments
- 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 
Value
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 
References
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 .