### If you want to estimate an expected effect size of
### 0.5 (tentatively qualified as a 'moderate' association),
### and you want to estimate with a maximum confidence interval
### width of .1 (e.g. from .45 to .55), you'll need a lot of people:
pwr.cohensdCI(.5, w=.05);
### If you expect a smaller effect and are content with a less
### accurate estimation, you'll need way less (but still a lot):
pwr.cohensdCI(.2, w=.1);
### If you want more extensive feedback:
pwr.cohensdCI(.2, w=.1, extensive=TRUE);
### As Cohen's d becomes larger, the confidence interval widens and
### therefore, you need more people:
pwr.cohensdCI(c(.2, .5, .8), w=.1);
Run the code above in your browser using DataLab