[R] Power of t-test in R vs. S-PLUS

joern.quedenau@metanomics.de joern.quedenau at metanomics.de
Fri Mar 1 11:04:38 CET 2002



Dear all,

I found a discrepancy while performing a power calculation for a two sample
t-test in R and S-PLUS, respectively.
For given values of sample number (5 each), sd (0.2) , significance level
(0.01), and a desired power (80%) I looked for the difference in means.
These values differ: 0.5488882 in R and 0.4322771 in S-PLUS (see dump
below).

Did I overlook any detail or confuse some parameters?

Thanks for your help,
Joern Quedenau

Here are the commands & outputs from both tools:

R 1.4.0
> power.t.test(n=5, sd=0.2, sig.level=0.01, power=0.8, type="two.sample",
alternative="two.sided")

     Two-sample t test power calculation

              n = 5
          delta = 0.5488882
             sd = 0.2
      sig.level = 0.01
          power = 0.8
    alternative = two.sided

 NOTE: n is number in *each* group

S-PLUS 2000 Professional Release 2:
> normal.sample.size(n1=5, n2=5, mean=0, sd1=0.2, sd2=0.2, power=0.8,
alpha=0.01, alternative="two.sided")
  mean1 sd1     mean2 sd2     delta alpha power n1 n2 prop.n2
1     0 0.2 0.4322771 0.2 0.4322771  0.01   0.8  5  5       1

------------------------------------------
Dr. Jörn Quedenau
Coordinator Data Management Bioinformatics
Metanomics GmbH & Co. KGaA
Tegeler Weg 33, D-10589 Berlin, Germany
Tel +49 30 34807 125, Fax +49 30 34807 300


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list