Learn R Programming

statpsych (version 1.7.0)

size.ci.oddsratio: Sample size for an odds ratio confidence interval

Description

Computes the sample size required to estimate an odds ratio with desired confidence interval precision.

Usage

size.ci.oddsratio(alpha, p1, p2, or, r)

Value

Returns the required sample size

Arguments

alpha

alpha level for 1 - alpha confidence

p1

planning value for row 1 marginal proportion

p2

planning value for column 1 marginal proportion

or

planning value of odds ratio

r

desired upper to lower confidence interval endpoint ratio

Examples

Run this code
size.ci.oddsratio(.05, .3, .2, 5.5, 3.0)

# Should return:
#  Sample size
#          356


Run the code above in your browser using DataLab