is_valid_prob_triple: Verify that a triple of essential probability inputs is...

View source: R/comp_util.R

is_valid_prob_tripleR Documentation

Verify that a triple of essential probability inputs is valid.

Description

is_valid_prob_triple is a deprecated function that verifies that a set of 3 numeric inputs can be interpreted as a valid set of 3 probabilities.

Usage

is_valid_prob_triple(prev, sens, spec)

Arguments

prev

The condition's prevalence prev (i.e., the probability of condition being TRUE).

sens

The decision's sensitivity sens (i.e., the conditional probability of a positive decision provided that the condition is TRUE).

spec

The decision's specificity value spec (i.e., the conditional probability of a negative decision provided that the condition is FALSE).

Details

is_valid_prob_triple is a simplified version of is_valid_prob_set. It is a quick wrapper function that only verifies is_prob for all of its 3 arguments.

is_valid_prob_triple does not compute or return numeric variables. Use is_extreme_prob_set to verify extreme cases and comp_complete_prob_set to complete sets of valid probabilities.

Value

A Boolean value: TRUE if the probabilities provided are valid; otherwise FALSE.

See Also

is_extreme_prob_set verifies extreme cases; is_valid_prob_set verifies sets of probability inputs; is_valid_prob_pair verifies that probability pairs are complements; 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; 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_suff_prob_set(), is_valid_prob_pair(), is_valid_prob_set()

Examples

# ways to work:
is_valid_prob_triple(0, 0, 0)    # => TRUE
is_valid_prob_triple(1, 1, 1)    # => TRUE

## ways to fail:
# is_valid_prob_triple(0, 0)       # => ERROR (as no triple)
# is_valid_prob_triple(0, 0, 7)    # => FALSE + warning (beyond range)
# is_valid_prob_triple(0, NA, 0)   # => FALSE + warning (NA)
# is_valid_prob_triple("p", 0, 0)  # => FALSE + warning (non-numeric)


riskyr documentation built on Aug. 15, 2022, 9:09 a.m.