t_test_power: t-test Empirical Power

View source: R/t-test-power.R

t_test_powerR Documentation

t-test Empirical Power

Description

Calculates the empirical power of a test through simulated data for a given effect size of sample size (per group).

Usage

t_test_power(n, delta, nsim = 200L, alpha = 0.05, ...)

Arguments

n

integer(1). The sample size.

delta

double(1). The effect size.

nsim

integer(1). Number of simulations to perform in estimating power, (1 - \beta).

alpha

double(1). The significance threshold (\alpha), the probability of a significant result given the null hypothesis, i.e. a false positive. If desired, Bonferroni correction should be implemented here.

...

Passed to the underlying test, i.e. fisher.test(), t.test(), etc., e.g. ⁠alternative =⁠.

Value

The value of the empirically calculated power (1 - \beta).

Author(s)

Stu Field

See Also

t.test(), qt(), rnorm()

Examples

t_test_power(10, 0.5)

stufield/power documentation built on June 1, 2025, 7:16 p.m.