Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power_z_cor() can return negative probabilities #87

Closed
LukasRoeseler opened this issue Aug 16, 2024 · 1 comment · Fixed by #88
Closed

power_z_cor() can return negative probabilities #87

LukasRoeseler opened this issue Aug 16, 2024 · 1 comment · Fixed by #88
Assignees
Labels

Comments

@LukasRoeseler
Copy link

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 arcaldwell49 self-assigned this Aug 16, 2024
@arcaldwell49
Copy link
Collaborator

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.

@arcaldwell49 arcaldwell49 linked a pull request Aug 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants