power.twosampt: Compute power of the two-samples t-test

Description Usage Arguments Details Value Examples

View source: R/fdr-sampsize-v1.0e.R

Description

Estimate power of the two-samples t-test;Uses classical power formula for two-sample t-test;Assumes equal variance and sample size

Usage

1
power.twosampt (n, alpha, delta, sigma = 1) 

Arguments

n

per-group sample size (scalar)

alpha

p-value threshold (scalar)

delta

difference between population means (vector)

sigma

standard deviation (vector or scalar)

Details

For many applications, the null.effect is zero difference of means.

Value

vector of power estimates for two-sided test

Examples

1
2
3
4
5
6
7
8
 power.twosampt        # show the power function
 res=fdr.sampsize(fdr=0.1,
                  ave.pow=0.8,
                  pow.func=power.twosampt,
                  eff.size=rep(c(2,0),c(100,900)),
                  null.effect=0,
                  sigma=1)
 res

Example output

function (n, alpha, delta, sigma = 1) 
{
    1 - pf(qf(1 - alpha, 1, 2 * (n - 1)), 1, 2 * (n - 1), ncp = n * 
        (delta/sigma)^2/2)
}
<environment: namespace:FDRsampsize>
          n       alpha     ave.pow     fdr.hat     act.fdr 
8.000000000 0.008087158 0.800038317 0.083392914 0.083389697 

FDRsampsize documentation built on May 2, 2019, 9:14 a.m.