Computes the posterior probability of having a certain disease from prevalence, sensitivity, and specificity data.
Computes the posterior probability of having a certain disease from prevalence, sensitivity, and specificity data.
If experimental data on the sensitivity and the specificity of a diagnostic test are available, and the prevalence of the the condition is known with its raw data, then this function estimates the posterior probability of having the condition, with its 95% credible interval.
MedDiagn(x0, n0, x1, n1, x2, n2, N =10000, alpha =0.05, pdf =FALSE)
Arguments
x0: prevalence raw data: number of people with a certain condition
n0: number of people examined for that condition
x1: sensitivity data: number of people with the disease for whom this test was positive
n1: total number of people in the sensitivity sample
x2: specificity raw data: number of people who did not have the disease who tested negative
n2: total number of people in the specificity sample
N: number of cases to be simulated (best left at 10000 or greater
alpha: credibility required (default 95%)
pdf: set this to TRUE only if you want to keep a pdf-file of the posterior probability plot
Returns
none returned: a plot and printed information are produced
References
van Hulst, R. 2018. Evaluating Scientific Evidence. ms.