[Rd] small bug in power.t.test for two-sided alternatives (PR#2993)

vangel at nmr.mgh.harvard.edu vangel at nmr.mgh.harvard.edu
Tue May 13 15:12:26 MEST 2003


Full_Name: Mark Vangel
Version: 1.7
OS: FreeBSD 4.4
Submission from: (NULL) (18.155.1.81)


power.t.test returns a value for whichever of the arguments n, delta, power is
set
to "NULL".  If one sets the argument alternative='two.sided' (actually, this is
the default), 
then the function takes the absolute value of delta.  Unfortunately, before
taking 
the abs value, there is apparently no check for whether delta is NULL, resulting
in 
an error. For example,

power.t.test(n=10,delta=NULL,power=.9,alternative='two.sided')
Error in abs(delta) : non-numeric argument to function

The arguments delta and alternative are set to their defaults in this example;
omitting them results in the same error.

Yhis is easy to fix by adding the appropriate check, but I thought that I might
as well report it.

    Mark Vangel



More information about the R-devel mailing list