Lakens / TOSTER

TOST equivalence test and power functions
35 stars 18 forks source link

power_z_cor() can return negative probabilities #87

Closed LukasRoeseler closed 3 weeks ago

LukasRoeseler commented 1 month ago

When using extremely small values, negative values for power are reported that violate the probability axioms by Kolmogorov. Should they actually stop at alpha or at zero?

Reproducible example: TOSTER::power_z_cor(n = 10, rho = 0, power = NULL, null = .001, alpha = .05, alternative = "equivalence")

Output:

> TOSTER::power_z_cor(n = 10, rho = 0, power = NULL, null = .001, alpha = .05, alternative = "equivalence")

     Approximate Power for Pearson Product-Moment Correlation (z-test) 

              n = 10
            rho = 0
          alpha = 0.05
           beta = 1.799998
          power = -0.7999976
           null = 0.001, -0.001
    alternative = equivalence
arcaldwell49 commented 1 month ago

Good catch. I'm actually surprised the function doesn't fail in this case given how it works...

At the very least, the answer should be "0" for a TOST procedure like this.