From ripley at stats.ox.ac.uk  Wed Mar 31 20:53:25 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed Mar 31 20:53:32 2004
Subject: [Rd] R-1.9.0 Beta print.power.htest problem?
In-Reply-To: <1080758664.8937.56.camel@localhost.localdomain>
Message-ID: <Pine.LNX.4.44.0403311952090.25351-100000@gannet.stats>

Yes, thank you, that's it.  Fix committed.

On Wed, 31 Mar 2004, Marc Schwartz wrote:

> 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
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


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