is_valid_freq_set is a function that verifies that a set of
4 essential frequencies (hi, mi,
fa, and cr) forms a valid set of frequencies
(i.e., each value is a non-missing, non-negative numeric value).
Arguments
- hi
The number of hits
hi(or true positives).- mi
The number of misses
mi(or false negatives).- fa
The number of false alarms
fa(or false positives).- cr
The number of correct rejections
cr(or true negatives).- allow_noninteger
Boolean value for allowing non-integer (i.e., exact, non-rounded) frequencies. Default:
allow_noninteger = TRUE.
Details
Importantly, the values of the frequencies are not checked for consistency with current probabilities or population size parameters.
is_valid_freq_set is the frequency analog of
is_valid_prob_set and uses is_freq-style
criteria, but (by default) also accepts non-integer frequencies,
as riskyr uses exact (i.e., non-rounded) frequencies internally.
Setting allow_noninteger = FALSE additionally requires that all
4 frequencies are integers (e.g., for creating a population of individuals).
The function is vector-safe: When provided with vectors of frequencies,
it returns a single Boolean value that is TRUE only if all
elements are valid frequencies.
See also
is_freq verifies (integer) frequencies;
is_valid_prob_set verifies sets of probabilities;
comp_freq computes current frequency information;
freq contains current frequency information.
Other verification functions:
is_complement(),
is_extreme_prob_set(),
is_freq(),
is_integer(),
is_matrix(),
is_perc(),
is_prob(),
is_suff_prob_set(),
is_valid_prob_pair(),
is_valid_prob_set(),
is_valid_prob_triple()
Examples
is_valid_freq_set(1, 2, 3, 4) # => TRUE
#> [1] TRUE
is_valid_freq_set(10.5, 2, 3, 4) # => TRUE (non-integer allowed by default)
#> [1] TRUE
is_valid_freq_set(10.5, 2, 3, 4, allow_noninteger = FALSE) # => FALSE
#> [1] FALSE
is_valid_freq_set(1, 2, 3, NA) # => FALSE (due to NA)
#> [1] FALSE
is_valid_freq_set(1, 2, 3, -4) # => FALSE (due to negative value)
#> [1] FALSE
