From vangel at nmr.mgh.harvard.edu  Tue May 13 15:12:26 2003
From: vangel at nmr.mgh.harvard.edu (vangel@nmr.mgh.harvard.edu)
Date: Tue May 13 14:12:36 2003
Subject: [Rd] small bug in power.t.test for two-sided alternatives (PR#2993)
Message-ID: <200305131212.h4DCCQ2b027956@pubhealth.ku.dk>

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


[Rd] small bug in power.t.test for two-sided alternatives (PR#2993)
vangel@nmr.mgh.harvard.edu