ValidityTest: Print a formatted table with the validity test for the...

Description Usage Arguments Details Value Author(s) Examples

Description

This function creates a table showing the most common statistical validity metrics used for testing the validity of a screening test or a predictive model. The way that the output is formated is as follows:

################# Validity Test #######################

Observed
+ -
-----------------------------------------
Predicted + TP FP PPV
a b e (e1-e2)
-----------------------------------------
- FN TN NPV
c d f (f1-f2)
-----------------------------------------
Sensitivity Specificity Prevalence
g (g1-g2) h (h1-h2) i (i1-i2)
-----------------------------------------
Error: (FP+FN)/(TP+FP+FN+TN)
Accuracy: (TP+TN)/(TP+FP+FN+TN)
Precision: TP/(TP+FP)
Recall: TP/(TP+FN)
f1-Score*: 2*(Precision*Recall)/(Precision+Recall)

* F1-Score: Harmonic mean of precision and recall. ######################################################

Usage

1
ValidityTest(a,b,c,d,multi=100,caption = "Validity of the Model/Screening")

Arguments

a

the true positive (TP) value

b

the false positive (FP) value

c

the false negative (FN) value

d

the true negative (TN) value

multi

(Optional) The multiplier for the values. The default is 100 for calculating the percentage.

caption

the text to be printed as the title.

Details

The ValidityTest function returns a summary table with the validity metrics most commonly used in epidemiology and in statistical analysis.

Value

A character matrix containing the following statistical metrics:

TP

the true positive value

FP

the false positive value

PPV

the positive predictive value

FN

the false negative value

TN

the true negative value

NPV

the negative predictive value

FN

the false negative value

TN

the true negative value

NPV

the negative predictive value

Sensitivity

the sensitivity of the test

Specificity

the true negative value

Prevalence

the prevalence of the positive cases in the group

Error

the of incorrectly assigned cases

Accuracy

the true negative value

Precision

is the same as the PPV

Recall

Othe name for the sensitivity of the test

F1-Score

the armonic mean of the precision and the recall

All results are given with their confidence intervals.

Author(s)

Tomas Karpati M.D.

Examples

1
tab1 <- ValidityTest(110,20,80,324)

mechkar documentation built on March 13, 2020, 2:30 a.m.