[R] sample size for t-tests

Thomas Lumley tlumley at u.washington.edu
Tue Aug 31 20:49:54 CEST 2004

On Tue, 31 Aug 2004, Caimiao Wei wrote:

> Dear all,
> Could any one please tell me the exact formula R uses to calculate the
> sample size for one-sample and two-sample t-tests? Thanks,

There isn't a formula in closed form.  The exact procedure is in the code.

In words: the critical value for the t-test comes from a t-distribution.
The distribution of the t-statistic under the alternative is a non-central
t-distribution, and the sample size is adjusted to get the requested


More information about the R-help mailing list