odds.and.proportions: Interconvert odds and proportion values

odds.and.proportionsR Documentation

Interconvert odds and proportion values

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

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

# 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)

samplesizeCMH documentation built on May 29, 2024, 5:34 a.m.