odds.and.proportions | R Documentation |
These functions will create either odds for a given probability, probability for a given odds, calculate the odds ratio between two probabilities, or calculate effect size (raise a probability by theta)
prop2odds(p)
odds2prop(o)
effect.size(p, theta)
props2theta(p1, p2)
rr2theta(rr, p1, p2)
theta2rr(theta, p1, p2)
p , p1 , p2 |
Proportion vector. |
o |
Odds vector. |
theta |
Odds ratio vector. |
rr |
Relative risk vector ( |
A numeric vector.
Paul W. Egeler, M.S.
# Convert proportions of 0 through 1 to odds
props <- seq(0,1,0.1)
prop2odds(props)
# Convert odds to proportions
odds2prop(1:3)
# Raise a proportion by an effect size theta
effect.size(0.5, 2)
# Find the odds ratio between two proportions
props2theta(0.75, 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.