Re: [R] Power Analysis

From: Marc Schwartz <marc_schwartz_at_me.com>
Date: Tue, 19 Apr 2011 09:48:34 -0500

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

> "Inter ocular data"
> Quite amusing :)
> Thank you for the help. For some reason I was thinking that I could get the
> n values for the combined test, but that doesn't make sense as there could
> be an infinite number of combinations of n values.
> Thanks again for the replies.

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



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 19 Apr 2011 - 14:51:01 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Apr 2011 - 15:10:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive