predictive.value: Positive and negative predictive values for a diagnostic...

Description Usage Arguments Value References Examples

View source: R/predictive.value.R

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

1
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

1
2
p<-seq(0.001,0.1,length=10)
predictive.value(p,Spe=0.95,Sen=0.97,plot.it=TRUE)

BioProbability documentation built on Jan. 25, 2020, 1:06 a.m.