odds.and.proportions: Interconvert odds and proportion values

Description Usage Arguments Value Author(s) Examples

Description

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)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
prop2odds(p)

odds2prop(o)

effect.size(p, theta)

props2theta(p1, p2)

rr2theta(rr, p1, p2)

theta2rr(theta, p1, p2)

Arguments

p, p1, p2

Proportion vector.

o

Odds vector.

theta

Odds ratio vector.

rr

Relative risk vector (p1 / p2).

Value

A numeric vector.

Author(s)

Paul W. Egeler, M.S.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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 to proportions
props2theta(0.75, 0.5)

pegeler/samplesizeCMH documentation built on May 15, 2018, 9:31 p.m.