z_to_power: Compute power corresponding to z-scores

View source: R/tools.R

z_to_powerR Documentation

Compute power corresponding to z-scores

Description

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

Usage

z_to_power(
  z,
  alpha = 0.05,
  a = stats::qnorm(alpha/2, lower.tail = FALSE),
  two.sided = TRUE
)

Arguments

z

A vector of z-scores

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.

Examples

# mean powers corresponding to the mean components of KD2
z_to_power(0:6, alpha = .05)

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