# How to conduct sample size calculation for >2 groups in R?

I am attempting to determine the sample size needed in a clinical study of 2 treatment groups to one control group (3 groups total). However, I am not sure how to calculate this properly. Traditionally, the bsamsize function in the Hmisc package is what I have been using to calculate sample size if the desired power, proportions of each group being compared (p0 under null and p1 under alternative), and the fraction of observations in the first group. You can find this function's documentation here: https://www.rdocumentation.org/packages/Hmisc/versions/4.1-0/topics/bpower

So I am wondering, how would one go about calculating the sample size needed for, say, 2 treatment groups and 1 control group, if one wanted equal numbers of subjects in each group? In this case, I don't think there is a way to do this using the bsamsize function, since this assumes only one hypothesis being tested. How would I want to go about specifying multiple hypotheses (e.g., Control mean is different from Treatment 1 but not Treatment 2, Control mean is different from both Treatment 1 and Treatment 2, etc.)?

So far, I have tried the following code using generic values:

p1 = 0.1
p2 = 0.15
frac = 1/3
bsamsize(p1, p2, fraction=frac, alpha=.05, power=.8)


To get the output:

n1        n2
525.3318 1050.6636


I believe that the fraction needs to be 1/3 if I have 3 groups total. But, when using this function, we can only specify p1 and p2, and not a third proportion, say p3, to get 3 equal sample sizes for 3 total groups.

I am hoping that someone knows of a package that can handle a research question such as this. I also would be interested to know how to generalize this problem, say to compare 3, 4, 5, ..., x treatments to a control at once.

Thank you for any/all help!

• @MichaelChirico, That is probably a good idea. I am pretty new to Stack so I'm not quite sure how to move it - do you know how to?
– Nate
Jan 2 '18 at 13:57
• Darn, so the waiting game begins...
– Nate
Jan 2 '18 at 17:27
• How is the analysis going to be conducted? Trt1 vs Ctl, then Trt2 vs Ctl? Usually, you just take 50% more than the appropriate two sample test. Jan 2 '18 at 18:17
• I suppose that is also up for question - is there a 'most efficient' way to run a study such as this? If the treatments are assumed to have similar effect, then would what you suggested, @AdamO , be the same as my calculation above? Since one would get 525+525=1050, + 50% of 1050 is 1575?
– Nate
Jan 2 '18 at 18:46