Assume we know the sensitivity and the specificity of a certain diagnostic test from a usual 2\times 2 table. We know that these are not the useful metrics, so I want to convert them to positive and negative predictive value, which are the relevant (“forward information flow”) metrics. But, I want to show that these are not single, fixed values, rather, they depend on the prevalence, so I calculate their values for different prevalences. (Assuming that sensitivity and specificity is fixed, which I know might be a risky assumption, but I believe this is the best I can do if I have a 2\times 2 table and nothing more.) This is easy, the formulae are well-known, essentially the Bayes theorem.
But the question is: how to calculate the confidence interval for PPV and NPV in the above setting? Better yet: is there any R
package for this…?
I know it is easy to calculate the confidence interval for the particular prevalence implied by the 2\times 2 table, but note that the above setting is different, because in my question, the prevalence is an exogenously given input parameter (i.e., it has no sampling variability).