power_to_z: Compute z-score corresponding to a power

View source: R/tools.R

power_to_zR Documentation

Compute z-score corresponding to a power

Description

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

Usage

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)

zcurve documentation built on Nov. 2, 2023, 6:21 p.m.