Express a Probability Relative to Chance
rel_chance.RdConverts a probability or accuracy value to a chance-relative scale. The chance level is mapped to 0, and perfect performance is mapped to 1. Values below chance become negative.
Value
A numeric vector of chance-relative scores. Values are 0 at chance, 1 at perfect performance, and negative below chance.
Details
The transformation is:
$$ \frac{p - chance}{1 - chance} $$
This expresses performance as the proportion of the maximum possible improvement above chance.
For example, if `p = 0.75` and `chance = 0.5`, then the chance-relative score is `0.5`, meaning that performance covers 50 improvement from chance to perfect accuracy.
Examples
rel_chance(0.75, chance = 0.5)
#> [1] 0.5
rel_chance(c(0.55, 0.60, 0.70), chance = 0.5)
#> [1] 0.1 0.2 0.4