[R] Comprehensive power analysis/sample size package in R?

Frank E Harrell Jr f.harrell at vanderbilt.edu
Wed Jul 15 23:01:20 CEST 2009


Greg Snow wrote:
> I don't know of a single package that is comparable to PASS, but the R system itself is the most comprehensive tool available for power and sample size computations.
> 
> For the simple cases you already found the pwr package, there are also some power functions in the stats package and in some other packages and these will be comparable to the equivalent (or possibly better) than the simple ones in PASS.
> 
> When things get a bit more complicated then there are a few different options for what to do next:
> 
> 1. Don't provide anything for the more complicated cases.
> 2. Provide a minimal set of routines for more complicated cases based on programmer assumptions rather than information from someone familiar with the source of the data (assumptions often hidden).
> 3. Provide many different routines encompassing every alternative set of assumptions that the programmer can think of forcing the user to sort through all the options to find the one that is closest (and maybe the same) as what they want to do.
> 4  Provide a full programming language so that the people familiar with the question(s) of interest and the source of the data can explicitly spell out the desired analysis and assumptions.
> 5. possible others, but I can't think of any.
> 
> It looks like PASS uses option 3, giving many different routines that any one user in only likely to use a few of.
> 
> R is option 4.  You can decide what assumptions you want to make about the data (and later change any of those assumptions), decide how you plan to analyze the data, then by simulation you can work out the power/sample size/etc. knowing exactly what assumptions went into the analysis.
> 

As one example of what Greg is talking about see 
http://bm2.genes.nig.ac.jp/RGM2/R_current/library/Hmisc/man/spower.html

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list