Monte Carlo simulated NPV, PPV, LR+, and LR- given distributions for prevalence, Se, and Sp
WinBUGS 1.4 code that takes the simple one test parameters (prevalence, Se and Sp) and calculates positive predictive value (PPV) and negative predictive value (NPV) along with likelihood ratio positive (LR+) and likelihood ratio negative (LR-). Note that the posterior distributions for LR+ and LR- depend only on the prior distributions for Se and Sp since the apparent prevalence data contain no information to update the priors.
model
{
x ~ dbin(AP, n)
AP <- pi*se + (1-pi)*(1-sp)
se ~ dbeta(ase,bse)
sp ~ dbeta(asp,bsp)
pi ~ dbeta(api,bpi)
PPV <- pi*se/AP
NPV <- (1-pi)*sp/(1-AP)
LRP <- se/(1-sp)
LRN <- (1-se)/sp
}
DAT
list(n=91,x=1,ase=22.5,bse=10.22,asp=88.28,bsp=1.882,api=1.80,bpi=26.74)
## Use BetaBuster to obtain the following results (ase,...)
## Mode=0.70, 95% sure se > 0.55
## Mode=0.99, 95% sure sp > 0.95
## Mode=0.03, 95% sure pi < 0.15
##Initial values
list(pi=0.03,se=0.70,sp=0.99)
# Positive predictive value (PPV) = The proportion of all individuals with a
# positive test who actually have the disease
# Negative predictive value (NPV) = The proportion of all individuals with a
# negative test who do not have the disease
# The likelihood ratio for a positive test result (LR+):
# LR+ = sensitivity/(1-specificity)
# The likelihood ratio for a negative test result (LR-):
# LR- = (1-sensitivity)/specificity
node |
mean |
sd |
MC error |
2.50% |
median |
97.50% |
start |
sample |
LRN |
0.327 |
0.0829 |
8.63E-04 |
0.1769 |
0.3239 |
0.4986 |
10001 |
10000 |
LRP |
106.9 |
202.2 |
1.878 |
19.05 |
61.87 |
473.2 |
10001 |
10000 |
NPV |
0.9908 |
0.007312 |
6.46E-05 |
0.9722 |
0.9927 |
0.999 |
10001 |
10000 |
PPV |
0.5748 |
0.227 |
0.002149 |
0.1198 |
0.5956 |
0.94 |
10001 |
10000 |
pi |
0.02688 |
0.01812 |
1.68E-04 |
0.003491 |
0.02318 |
0.07178 |
10001 |
10000 |
se |
0.6772 |
0.08172 |
8.50E-04 |
0.5082 |
0.68 |
0.8261 |
10001 |
10000 |
sp |
0.9873 |
0.008698 |
7.95E-05 |
0.9659 |
0.9892 |
0.9985 |
10001 |
10000 |