R/comp_prob_prob.R
comp_complete_prob_set.Rd
comp_complete_prob_set
is a function takes a
valid set of (3 to 5) probabilities as inputs (as a vector)
and returns the complete set of
(3 essential and 2 optional) probabilities.
comp_complete_prob_set(prev, sens = NA, mirt = NA, spec = NA, fart = NA)
The condition's prevalence prev
(i.e., the probability of condition being TRUE
).
The decision's sensitivity sens
(i.e., the conditional probability of a positive decision
provided that the condition is TRUE
).
sens
is optional when its complement mirt
is provided.
The decision's miss rate mirt
(i.e., the conditional probability of a negative decision
provided that the condition is TRUE
).
mirt
is optional when its complement sens
is provided.
The decision's specificity value spec
(i.e., the conditional probability
of a negative decision provided that the condition is FALSE
).
spec
is optional when its complement fart
is provided.
The decision's false alarm rate fart
(i.e., the conditional probability
of a positive decision provided that the condition is FALSE
).
fart
is optional when its complement spec
is provided.
Assuming that is_valid_prob_set = TRUE
this function uses comp_comp_pair
on the
two optional pairs (i.e.,
sens
and mirt
, and
spec
and fart
) and
returns the complete set of 5 probabilities.
is_valid_prob_set
verifies a set of probability inputs;
is_extreme_prob_set
verifies extreme cases;
comp_comp_pair
computes pairs of complements;
is_complement
verifies numeric complements;
is_prob
verifies probabilities;
comp_prob
computes current probability information;
prob
contains current probability information;
init_num
initializes basic numeric variables;
num
contains basic numeric variables.
Other functions computing probabilities:
comp_FDR()
,
comp_FOR()
,
comp_NPV()
,
comp_PPV()
,
comp_accu_freq()
,
comp_accu_prob()
,
comp_acc()
,
comp_comp_pair()
,
comp_complement()
,
comp_err()
,
comp_fart()
,
comp_mirt()
,
comp_ppod()
,
comp_prob_freq()
,
comp_prob()
,
comp_sens()
,
comp_spec()
# ways to work:
comp_complete_prob_set(1, .8, NA, .7, NA) # => 1.0 0.8 0.2 0.7 0.3
#> [1] 1.0 0.8 0.2 0.7 0.3
comp_complete_prob_set(1, NA, .8, NA, .4) # => 1.0 0.2 0.8 0.6 0.4
#> [1] 1.0 0.2 0.8 0.6 0.4
# watch out for:
comp_complete_prob_set(8) # => 8 NA NA NA NA + warnings
#> Warning: One argument (either p1 or p2) is necessary.
#> Warning: One argument (either p1 or p2) is necessary.
#> [1] 8 NA NA NA NA
comp_complete_prob_set(8, 7, 6, 5, 4) # => 8 7 6 5 4 + no warning (valid set assumed)
#> [1] 8 7 6 5 4
comp_complete_prob_set(8, .8, NA, .7, NA) # => 8.0 0.8 0.2 0.7 0.3 + no warning (sic)
#> [1] 8.0 0.8 0.2 0.7 0.3
comp_complete_prob_set(8, 2, NA, 3, NA) # => 8 2 NA 3 NA + no warning (sic)
#> [1] 8 2 NA 3 NA