Lasse Kliemann <la...@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.)
signature.asc
Description: PGP signature
______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.