main.m436 chars15 lines
The function true_negative
takes the sensitivity sens
, specificity spec
and the prior probability of a negative test prior
as input and outputs the probability of a negative test being true. The formula used is the Bayes' theorem where comp_sens
, comp_spec
and comp_prior
are the complementary probabilities of sensitivity, specificity and prior respectively. The result tn
is calculated with Bayes' formula where tn
is the probability of a negative test being true.
gistlibby LogSnag