Skip to content
Prev 257390 / 398506 Next

Power Analysis

On Apr 19, 2011, at 8:43 AM, Schatzi wrote:

            
Just a quick follow up comment, specifically pertaining to the description of function arguments in R's help files. If a function argument can take more than one value, the argument description in the help file will typically (albeit, not absolutely always) include the word 'vector'. For example:

 x    a numeric vector ...

and frequently, the examples in the help files would include such use. The Details section of the help file will also typically elaborate on this, where appropriate, perhaps based upon context.

What you were observing, is an unintended consequence of the vector cycling of your 'n' and 'sd' arguments internally in the function, enabling the result to include two values in the output, where in fact, only one is intended. This is, as was noted by Albyn, the result of two independent power analyses.

Also, there was a post some time ago with a proposal from Claus Ekstr?m, describing a modification of power.t.test() to handle different sample sizes and variances:

  http://tolstoy.newcastle.edu.au/R/devel/03b/0492.html

which might be worth a look. I don't see a reply and needless to say, the modification has not been made to the core R function.

HTH,

Marc Schwartz