
Compute a complete set of probabilities from valid probability inputs.
Source: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.
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
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.
See also
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_acc()
,
comp_accu_freq()
,
comp_accu_prob()
,
comp_comp_pair()
,
comp_complement()
,
comp_err()
,
comp_fart()
,
comp_mirt()
,
comp_ppod()
,
comp_prob()
,
comp_prob_freq()
,
comp_sens()
,
comp_spec()
Examples
# 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