Re: [Rd] bug in power.t.test( ) (PR#7245)

From: <ligges_at_statistik.uni-dortmund.de>
Date: Fri 24 Sep 2004 - 16:43:56 EST


mai@ms.uky.edu wrote:
> Full_Name: Mai Zhou
> Version: 1.9.1
> OS: Win XP Professional
> Submission from: (NULL) (12.222.227.93)
>
>
>

>>power.t.test(n=25, delta=0.1, sig.level=1.1, strict=TRUE, type="one.sample")

>
>
> One-sample t test power calculation
>
> n = 25
> delta = 0.1
> sd = 1
> sig.level = 1.1
> power = 1.088311
> alternative = two.sided
>
> ### power can never be over one! Of course, sig.level should not take value > 1
> ### either.
> ### Possible solution: A check in the input to truncate sig.level into [0, 1]??

Well, an error (or at least warning) message seems to be more appropriate rather than silently changing some values, e.g. somehwere at the top of the functions body:

     if(any(sig.level < 0 | sig.level > 1))
         stop("sig.level must be in [0,1]")


Uwe Ligges

> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Sep 24 16:48:12 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:17 EST