Learn R Programming

FDRsampsize (version 1.0)

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

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

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)

Value

Details

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

Examples

Run this code
 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

Run the code above in your browser using DataLab