predictive.value {BioProbability} | R Documentation |
Positive and negative predictive values for a diagnostic test.
Description
This function calculates the positive and negative predictive values for a diagnostic test from the prevalence, the sensitivity and the specificity values using the Bayes' theorem. For more details, see Agresti (2018, ISBN: 978-1-119-40528-3).
Usage
predictive.value(p, Spe, Sen, plot.it = FALSE)
Arguments
p |
a numeric value indicating the prevalence of the disease. It is possible to consider a numeric vector of different values for the prevalence. |
Spe |
a numeric value corresponding to the specificity of the diagnostic test. |
Sen |
a numeric value corresponding to the sensitivity of the diagnostic test. |
plot.it |
a logical value indicating whether the scatterplots for the prevalence values and the corresponding predictive values for the diagnostic test must be plotted. |
Value
A matrix of three columns. The first column contains the vector of prevalences p
. The second and third columns contain the corresponding positive and negative predictive values, respectively.
If plot.it=TRUE
, the scatterplots for the prevalence values and the predictive values is are plotted.
References
Agresti, A. (2018). An introduction to categorical data analysis. John Wiley & Sons. ISBN: 978-1-119-40528-3.
Examples
p<-seq(0.001,0.1,length=10)
predictive.value(p,Spe=0.95,Sen=0.97,plot.it=TRUE)