vec_power: Vectorized power estimates

View source: R/misc_fns.R

vec_powerR Documentation

Vectorized power estimates

Description

This function allows you to use power.t.test, power.prop.test, etc in vectorized fashion and return a table of results

Usage

vec_power(fun = stats::power.t.test, ...)

Arguments

fun

a power calculating function; <function>

...

the arguments for the power calculating function assigned to 'fun';

Value

tibble of results

Examples

# single non-vectorized output
vec_power(fun = power.t.test, n = 100, delta = 1, sd = 1, sig.level = 0.05)

# multiple vectorized output
vec_power(fun = power.t.test, n = 80:100, delta = 1, sd = 1, sig.level = 0.05)

# every combination of arguments vectorized output
vec_power(fun = power.t.test, n = 90:100, delta = 1, sd = seq(0, 1, length=10), sig.level = 0.05)


CIDA-CSPH/CIDAtools documentation built on Sept. 18, 2023, 10:55 a.m.