p_to_o: Convert probability to odds.

Description Usage Arguments Details Value See Also Examples

View source: R/prob-odds.R

Description

p_to_o() converts decimal probability to odds.

Usage

1
p_to_o(probability, print = FALSE)

Arguments

probability

A single numeric decimal probability (i.e., a number between 0 and 1).

print

A logical indicating whether to print a sentence description of the calculated odds for the given probaiblity.

Details

If print = TRUE, an explanatory sentence will be printed in the form "If the probability of an event occuring is <probability>, the odds are <decimal odds> or <ratio:odds>."

Value

The output will be decimal odds. If print = TRUE, the decimal odds will be returned invisibly.

See Also

o_to_p for converting odds to probability.

Examples

1
2
3
4
p_to_o(0.5)
p_to_o(0.1, print = TRUE)
calculated_odds <- p_to_o(0.9, print = TRUE)
calculated_odds

ricompute/llusmstats documentation built on May 24, 2019, 6:18 a.m.