Other functions translating between representational formats:
comp_freq_freq
(defined here) is
an analog to 3 other format conversion functions:
comp_freq_prob
computes
current frequency information contained in freq
from 3 essential probabilities
(prev
, sens
, spec
).
comp_prob_freq
computes
current probability information contained in prob
from 4 essential frequencies
(hi
, mi
, fa
, cr
).
comp_prob_prob
computes
current probability information contained in prob
from 3 essential probabilities
(prev
, sens
, spec
).
Two perspectives:
A population of N
individuals can be split into 2 subsets
in 2 different ways:
by condition:
The frequency cond.true
depends on the prevalence prev
and
the frequency cond.false
depends on the prevalence's complement 1 - prev
.
by decision:
The frequency dec.pos
depends on the proportion of positive decisions ppod
and
the frequency dec.neg
depends on the proportion of negative decisions 1 - ppod
.
The population size N
is a free parameter (independent of the
essential probabilities prev
, sens
, and spec
).
If N
is unknown (NA
), a suitable minimum value can be computed by comp_min_N
.
Combinations of frequencies:
In a population of size N
the following relationships hold:
N = cond.true + cond.false = (hi + mi) + (fa + cr)
(by condition)
N = dec.pos + dec.neg = (hi + fa) + (mi + cr)
(by decision)
N = hi + mi + fa + cr
(by condition x decision)
The two perspectives (by condition vs. by decision) combine the 4 essential frequencies
(i.e., hi
, mi
, fa
, cr
)
in 2 different ways.
Defining probabilities in terms of frequencies:
Probabilities are -- determine, describe, or are defined as -- the relationships between frequencies.
Thus, they can be computed as ratios between frequencies.
The following relationships hold (and are used in computations):
prevalence prev
:
prev = cond.true/N = (hi + mi) / (hi + mi + fa + cr)
sensitivity sens
:
sens = hi/cond.true = hi / (hi + mi) = (1 - mirt)
miss rate mirt
:
mirt = mi/cond.true = mi / (hi + mi) = (1 - sens)
specificity spec
:
spec = cr/cond.false = cr / (fa + cr) = (1 - fart)
false alarm rate fart
:
fart = fa/cond.false = fa / (fa + cr) = (1 - spec)
proportion of positive decisions ppod
:
ppod = dec.pos/N = (hi + fa) / (hi + mi + fa + cr)
positive predictive value PPV
:
PPV = hi/dec.pos = hi / (hi + fa) = (1 - FDR)
negative predictive value NPV
:
NPV = cr/dec.neg = cr / (mi + cr) = (1 - FOR)
false detection rate FDR
:
FDR = fa/dec.pos = fa / (hi + fa) = (1 - PPV)
false omission rate FOR
:
FOR = mi/dec.neg = mi / (mi + cr) = (1 - NPV)