ttest.pow: Compute the power using a one- or two-sample unpaired t-test.

Description Usage Arguments Value See Also Examples

Description

ttest.pow computes (via simulation) the power of an experiment that will be analyzed using a t-test. When two means are provided, function assumes a two-sample unpaired t-test, and n is interpreted as the sample size of each group (for a total sample size or 2n).

Usage

1
2
ttest.pow(means, var, n, r = 10000, alternative = c("two.sided", "less",
  "greater"), mu = NULL, alpha = 0.05, conf.level = 0.95)

Arguments

means

either a list with two average values (computes a two-sample t-test) or a single value (computes a one-sample t-test).

var

expected variance in each group.

n

sample size.

r

number of simulations to compute power.

alternative

type of alternative hypothesis in binomial test. Must be "two.sided" (default), "greater", or "less".

mu

mean value according to null hypothesis (default = 0). Only used in one sample t-tests.

alpha

significance threshhold.

Value

The probability of finding p < α with the experiment description.

See Also

ttest.pow, ttest.ppow, ttest.explore, and ttest.pexplore.

Examples

1
2
3
ttest.pow(means=c(5, 10), var=10, n=16) # two-sample t-test. n=16 refers to each condition, for a total of 32.
ttest.pow(means=20, var=10, n=16) # one-sample t-test. Comparing if average is different from 0. Because there is only condition, the total sample isze is 16.
ttest.pow(means=20, var=10, n=16, mu=10, alternative="higher") # one-sample t-test. Comparing if average is higher than 10.

julianje/mcpa documentation built on May 13, 2019, 6:14 p.m.