sensitivity.specificity {BioProbability}R Documentation

Sensitivity and specificity for a diagnostic test.

Description

This function calculates the sensitivity and specificity for a diagnostic test. Definition of these two concepts can be found in Agresti (2018, ISBN: 978-1-119-40528-3).

Usage

sensitivity.specificity(A, show.matrix = FALSE)

Arguments

A

a 2x2 matrix object where A[1,1] contains the number of people with the disease and with a positive test result; A[1,2], the number of people without the disease with a positive test result; A[2,1], the number of people with the disease with a negative test result; A[2,2], the number of people without the disease and with a negative test result.

show.matrix

a logical value indicating whether the matrix A must be shown.

Value

A vector object of two components: The first one cointains the sensitivity and the second component, the specificity.

References

Agresti, A. (2018). An introduction to categorical data analysis. John Wiley & Sons. ISBN: 978-1-119-40528-3.

Examples

A<-matrix(c(744,231,421,659),nrow=2)
sensitivity.specificity(A,show.matrix=TRUE)

[Package BioProbability version 1.0 Index]