[R] delta and sd parameters for power.t.test [solved]

Lasse Kliemann lasse at lassekliemann.de
Fri Dec 15 10:37:48 CET 2017

Lasse Kliemann <lasse at lassekliemann.de> writes:

> What is the rationale behind having both the delta and sd parameters for
> the power.t.test function? For the relevant noncentrality parameter, we
> only need the ratio delta/sd. If my effect size is given as Cohen's d,
> then I only got that ratio and not sd.
> As far as I see, in such a case, I can specify delta=d and leave sd at
> its default value 1.

Looking at the code in src/library/stats/R/power.R has clarified this
for me. The only spots were a given value of sd is actually used is (1)
in the computation of the ncp, where we have sqrt(n/tsample) * delta/sd,
so only the ratio delta/sd counts; (2) when delta is to be computed,
then sd is used for the interval given to uniroot, namely sd * c(1e-7,
1e+7), which I guess is a heuristic to cover all the plausible
values. So, yes, Cohen's d can be passed as delta=d when sd=1 is
maintained. Maybe a comment on this in the documentation would be
helpful. (For example, the pwr package
https://CRAN.R-project.org/package=pwr already mentions Cohen's d, but
that package is non-standard and unfortunately not even contained in the
Debian repositories. So it can make sense to stick with the standard
power.t.test as far as possible.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20171215/5852c06b/attachment.sig>

More information about the R-help mailing list