comp_complement computes the probability complement of a given probability prob.

comp_complement(prob)

Arguments

prob

A numeric probability value (in range from 0 to 1).

Value

A numeric probability value (in range from 0 to 1).

Details

The type and range of prob is verified with is_prob.

See also

is_complement verifies numeric complements; comp_comp_pair returns a probability and its complement; is_prob verifies probabilities.

Other functions computing probabilities: comp_FDR(), comp_FOR(), comp_NPV(), comp_PPV(), comp_accu_freq(), comp_accu_prob(), comp_acc(), comp_comp_pair(), comp_complete_prob_set(), comp_err(), comp_fart(), comp_mirt(), comp_ppod(), comp_prob_freq(), comp_prob(), comp_sens(), comp_spec()

Examples

comp_complement(0)    # => 1
#> [1] 1
comp_complement(1)    # => 0
#> [1] 0

comp_complement(2)    # => NA + warning (beyond range)
#> [1] NA
comp_complement("p")  # => NA + warning (non-numeric)
#> [1] NA