[Rd] R-1.9.0 Beta print.power.htest problem?

Marc Schwartz MSchwartz at MedAnalytics.com
Wed Mar 31 20:44:25 CEST 2004


Hi all,

I just used power.t.test() in Version 1.9.0 beta (2004-03-31) today
under FC1.

The following is the output:

> power.t.test(delta = .5, power = .95, type = "paired")
$n
[1] 53.94062

$delta
[1] 0.5

$sd
[1] 1

$sig.level
[1] 0.05

$power
[1] 0.95

$alternative
[1] "two.sided"

$note
[1] "n is number of *pairs*, sd is std.dev. of *differences* within
pairs"

$method
[1] "Paired t test power calculation"

attr(,"class")
[1] "power.htest"



The following is the output from Version 1.8.1 Patched (2004-03-31):

>  power.t.test(delta = .5, power = .95, type = "paired")

     Paired t test power calculation 

              n = 53.94062
          delta = 0.5
             sd = 1
      sig.level = 0.05
          power = 0.95
    alternative = two.sided

 NOTE: n is number of *pairs*, sd is std.dev. of *differences* within
pairs 



I have reviewed the following code for print.power.htest in power.R in
both 1.8.1 patched and the 1.9.0 Beta and do not see any differences, so
I am guessing that there is a methods issue here:

print.power.htest <-
function(x, ...)
{
    cat("\n    ", x$method, "\n\n")
    note<-x$note
    x[c("method","note")] <- NULL
    cat(paste(format.char(names(x), width=15, flag="+"),
              format(x), sep=" = "),sep="\n")
    if(!is.null(note))
        cat("\n", "NOTE:", note, "\n\n")
    else
        cat("\n")
}


Using 'methods(print)' in 1.8.1 patched, print.power.htest is listed,
while it is not listed in 1.9.0 beta, which would seem to reinforce a
methods problem.

The 1.8.1 patched NAMESPACE file for 'ctest' lists:

S3method(print, power.htest)

However, the NAMESPACE file for 'stats' in 1.9.0 Beta does not, so I am
guessing that this is the source of the problem?

Thanks,

Marc Schwartz



More information about the R-devel mailing list