# NOT RUN {
# Provide theoretical distributions of outcomes for each group
# Distributions taken from Lees et. al. (2010). See ?alteplase for a citation.
p0 <- c(0.224,0.191,0.082,0.133,0.136,0.043,0.191)
p1 <- c(0.109,0.199,0.109,0.120,0.194,0.070,0.200)
# Calculate sample size required to achieve 80% and 90%
# power for these distributions
genodds.power(p0,p1,power=c(0.8,0.9))
# genodds.power suggests a total sample size of 619 for 80% power.
# Round up to 620 for even sample size per group
# Confirm these sample sizes lead to 80% and 90% power
genodds.power(p0,p1,N=c(620,830))
# }
Run the code above in your browser using DataLab