On Jul 14, 2010, at 6:13 AM, Karl Knoblick wrote:

> Hallo!
> 
> Does anyone know a possibility to perform a sample size estimation for an 
> ANCOVA? Would be great! 
> 
> 
> Thanks
> Karl


I don't know of a function in R that performs this directly. However, if you 
Google:

  http://lmgtfy.com/?q=ancova+sample+size

There are various online resources, including the following online calculator:

  http://udel.edu/~mcdonald/statancova.html

This uses the method described in:

Borm, G.F., J. Fransen, and W.A.J.G. Lemmens. 2007. 
A simple sample size formula for analysis of covariance in randomized clinical 
trials. 
J. Clin. Epidem. 60: 1234-1238.


If you know how to read the page's HTML source code in your browser, you can 
view the JavaScript for the calculation and replicate it in R.

Using the default example on the page:

Diff in Y Intercepts: 0.2
Within Group SD: 1.23
Within Group r^2: 0.777
Alpha: 0.05
Power = 0.8
Two Sided

Sample size needed in each group: 133


I was able to replicate the results by using:

# See ?power.t.test

> (1 - 0.777) * power.t.test(delta = 0.2, sd = 1.23, power = 0.8)$n
[1] 132.6160


Testing the above with other inputs, I come up with consistent results as 
compared to the online calculator.

HTH,

Marc Schwartz

______________________________________________
R-help@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.

Reply via email to