comp_ppod {riskyr}R Documentation

Compute the proportion of positive decisions (ppod) from probabilities.

Description

comp_ppod computes the proportion of positive decisions ppod from 3 essential probabilities prev, sens, and spec.

Usage

comp_ppod(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

comp_ppod uses probabilities (not frequencies) as inputs and returns a proportion (probability) without rounding.

Definition: ppod is proportion (or probability) of positive decisions:

ppod = dec_pos/N = (hi + fa)/(hi + mi + fa + cr)

Values range from 0 (only negative decisions) to 1 (only positive decisions).

Importantly, positive decisions dec_pos are not necessarily correct decisions dec_cor.

Value

The proportion of positive decisions ppod as a probability. A warning is provided for NaN values.

See Also

comp_sens and comp_NPV compute related probabilities; is_extreme_prob_set verifies extreme cases; comp_complement computes a probability's complement; is_complement verifies probability complements; comp_prob computes current probability information; prob contains current probability information; 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_complement(), comp_complete_prob_set(), comp_err(), comp_fart(), comp_mirt(), comp_prob_freq(), comp_prob(), comp_sens(), comp_spec()

Examples

# (1) ways to work:
comp_ppod(.10, .200, .300)  # => ppod = 0.65
comp_ppod(.50, .333, .666)  # => ppod = 0.3335

# (2) watch out for vectors:
prev <- seq(0, 1, .1)
comp_ppod(prev, .8, .5)  # => 0.50 0.53 0.56 0.59 0.62 0.65 0.68 0.71 0.74 0.77 0.80
comp_ppod(prev,  0,  1)  # => 0 0 0 0 0 0 0 0 0 0 0

# (3) watch out for extreme values:
comp_ppod(1, 1, 1)  #  => 1
comp_ppod(1, 1, 0)  #  => 1

comp_ppod(1, 0, 1)  #  => 0
comp_ppod(1, 0, 0)  #  => 0

comp_ppod(0, 1, 1)  #  => 0
comp_ppod(0, 1, 0)  #  => 1

comp_ppod(0, 0, 1)  #  => 0
comp_ppod(0, 0, 0)  #  => 1


[Package riskyr version 0.4.0 Index]