# Power of paired t-test: R vs. SAS

If we are trying to find the power of a paired t-test, SAS offers this template (among others) in PROC POWER:

   proc power;
pairedmeans test=diff
meandiff = 7
corr = 0.4
stddev = 12
npairs = 50
power = .;
run;


R, on the other hand, has this:

pwr.t.test(n = NULL, d = NULL, sig.level = 0.05, power = NULL,
type = c("two.sample", "one.sample", "paired"),
alternative = c("two.sided", "less", "greater"))


where there is no way to specify the correlation. But the correlation makes a huge difference to the results. d (the effect size) is Cohen's d (difference in the means divided by pooled standard deviation).

Is this an error in the R program (that seems very unlikely) or have I missed something (far more likely) and, if I have missed something, what is it I have missed?

• I presume you're using the function from the R package pwr. See the second example in the help of pwr.t.test (that sqrt(1-0.6) in the calculation of d is where the correlation comes in; the correlation in that example was 0.6). Compare against Cohen (1988) Statistical power analysis for the behavioral sciences (2ed.) as indicated in the help. – Glen_b Mar 4 at 4:53
• Ah. Now I see. Thanks. I still think the SAS method is easier to use, but at least I realize that R is also correct (which I was pretty sure of, anyway). – Peter Flom Mar 4 at 11:15