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

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

1 2 3 4 5 6 |

`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 |

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.

Object of class `"power.htest"`

, a list of the arguments
(including the computed one) augmented with `method`

and
`note`

elements.

`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.

Peng Liu, based on `power.t.test`

code by Peter Dalgaard,
which in turn is based on previous work by Claus
Ekstrøm

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 May 6, 2019, 3:34 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.