A function for computing z-scores of two-sided tests corresponding to power power for a given significance level alpha alpha (or corresponding cut-off z-statistic a).

power_to_z(
  power,
  alpha = 0.05,
  a = stats::qnorm(alpha/2, lower.tail = FALSE),
  two.sided = TRUE,
  nleqslv_control = list(xtol = 1e-15, maxit = 300, stepmax = 0.5)
)

Arguments

power

A vector of powers

alpha

Level of significance alpha

a

Or, alternatively a z-score corresponding to alpha

two.sided

Whether directionality of the effect size should be taken into account.

nleqslv_control

A named list of control parameters passed to the nleqslv function used for solving the inverse of z_to_power function.

Examples

# z-scores corresponding to the (aproximate) power of components of EM2
power_to_z(c(0.05, 0.20, 0.40, 0.60, 0.80, 0.974, 0.999), alpha = .05)
#> [1] 0.000197359 1.114571417 1.706298343 2.213272223 2.801581787 3.903097682
#> [7] 5.050194967