power.t.test.FDR: Power calculations for one and two sample t tests using FDR...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Compute power of test, or determine parameters to obtain target power.

Usage

1
2
3
4
5
6
power.t.test.FDR(sd=1, n=NULL, delta=NULL,
                 FDR.level=0.05,
                 pi0,
                 power=NULL, 
                 type=c("two.sample", "one.sample", "paired"),
                 alternative=c("two.sided", "one.sided") ) 

Arguments

sd

Standard deviation

n

Number of observations (per group)

delta

True difference in means

FDR.level

False Discovery Rate (expected ratio of false discoveries among all discoveries)

pi0

Proportion of true null hypothesies (fraction of tests that with no difference)

power

Power of test (1 minus Type II error probability)

type

Type of t test

alternative

One- or two-sided test

Details

Exactly one of the parameters n, delta, power, sd, and FDR.level must be passed as NULL, and that parameter is determined from the others. Notice that the last two have non-NULL defaults so NULL must be explicitly passed if you want to compute them.

Value

Object of class "power.htest", a list of the arguments (including the computed one) augmented with method and note elements.

Note

uniroot is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given.

Author(s)

Peng Liu, based on power.t.test code by Peter Dalgaard, which in turn is based on previous work by Claus Ekstrøm

See Also

t.test, uniroot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
 ## Compute power given sd, n, delta, FDR & pi.0
 power.t.test.FDR(sd=1, n=5, delta=2, FDR.level=0.05, pi0=0.95,
                  power=NULL, type="two.sample", alternative="two.sided")

 ## Compute power
 power.t.test.FDR(n=20, delta=1, FDR=0.05, pi0=0.75)
 power.t.test.FDR(n=29, delta=1, FDR=0.05, pi0=0.75)

 ## compute n
 power.t.test.FDR(n=NULL, sd=1, power=.90, delta=1, FDR=0.05, pi0=0.975)
 power.t.test.FDR(n=NULL, sd=1, power=.90, delta=1, FDR=0.05, pi0=0.975,
                  alt="one.sided")

 ## compute sd
 power.t.test.FDR(sd=NULL, n=29, power=.90, delta=1, FDR=0.05, pi0=0.975)

 ## compute FDR level
 power.t.test.FDR(sd=1, n=29, power=.90, delta=1, FDR=NULL, pi0=0.975)

ssize documentation built on Nov. 8, 2020, 11:10 p.m.