is_suff_prob_set
is a function that
takes 3 to 5 probabilities as inputs and
verifies that they are sufficient to compute
all derived probabilities and combined frequencies
for a population of N
individuals.
Arguments
- prev
The condition's prevalence
prev
(i.e., the probability of condition beingTRUE
).- sens
The decision's sensitivity
sens
(i.e., the conditional probability of a positive decision provided that the condition isTRUE
).sens
is optional when its complementmirt
is provided.- mirt
The decision's miss rate
mirt
(i.e., the conditional probability of a negative decision provided that the condition isTRUE
).mirt
is optional when its complementsens
is provided.- spec
The decision's specificity value
spec
(i.e., the conditional probability of a negative decision provided that the condition isFALSE
).spec
is optional when its complementfart
is provided.- fart
The decision's false alarm rate
fart
(i.e., the conditional probability of a positive decision provided that the condition isFALSE
).fart
is optional when its complementspec
is provided.
Details
While no alternative input option for frequencies is provided,
specification of the essential probability prev
is always necessary.
However, for 2 other essential probabilities there is a choice:
is_suff_prob_set
does not verify the type, range, or
consistency of its arguments. See is_prob
and
is_complement
for this purpose.
See also
num
contains basic numeric variables;
init_num
initializes basic numeric variables;
prob
contains current probability information;
comp_prob
computes current probability information;
freq
contains current frequency information;
comp_freq
computes current frequency information;
is_valid_prob_set
verifies the validity of probability inputs;
as_pc
displays a probability as a percentage;
as_pb
displays a percentage as probability.
Other verification functions:
is_complement()
,
is_extreme_prob_set()
,
is_freq()
,
is_integer()
,
is_matrix()
,
is_perc()
,
is_prob()
,
is_valid_prob_pair()
,
is_valid_prob_set()
,
is_valid_prob_triple()
Examples
# ways to work:
is_suff_prob_set(prev = 1, sens = 1, spec = 1) # => TRUE
#> [1] TRUE
is_suff_prob_set(prev = 1, mirt = 1, spec = 1) # => TRUE
#> [1] TRUE
is_suff_prob_set(prev = 1, sens = 1, fart = 1) # => TRUE
#> [1] TRUE
is_suff_prob_set(prev = 1, mirt = 1, fart = 1) # => TRUE
#> [1] TRUE
# watch out for:
is_suff_prob_set(prev = 1, sens = 2, spec = 3) # => TRUE, but is_prob is FALSE
#> [1] TRUE
is_suff_prob_set(prev = 1, mirt = 2, fart = 4) # => TRUE, but is_prob is FALSE
#> [1] TRUE
is_suff_prob_set(prev = 1, sens = 2, spec = 3, fart = 4) # => TRUE, but is_prob is FALSE
#> [1] TRUE
## ways to fail:
# is_suff_prob_set() # => FALSE + warning (prev missing)
# is_suff_prob_set(prev = 1) # => FALSE + warning (sens or mirt missing)
# is_suff_prob_set(prev = 1, sens = 1) # => FALSE + warning (spec or fart missing)