powered by
Computes the sample size required to estimate an odds ratio with desired confidence interval precision.
size.ci.oddsratio(alpha, p1, p2, or, r)
Returns the required sample size
alpha level for 1 - alpha confidence
planning value for row 1 marginal proportion
planning value for column 1 marginal proportion
planning value of odds ratio
desired upper to lower confidence interval endpoint ratio
size.ci.oddsratio(.05, .3, .2, 5.5, 3.0) # Should return: # Sample size # 356
Run the code above in your browser using DataLab