From 9c025174891ad7de9e813ae824494e62ffcd2f99 Mon Sep 17 00:00:00 2001 From: john verzani Date: Mon, 2 Jan 2023 09:21:47 -0500 Subject: [PATCH] use bracketing (#18) --- Project.toml | 2 +- src/power.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 2595e63..9d54a26 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PowerAnalyses" uuid = "fee4b835-1841-44f8-82ea-42813857171a" authors = ["Rik Huijzer "] -version = "0.2.4" +version = "0.2.5" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/src/power.jl b/src/power.jl index 4be296a..f6e3538 100644 --- a/src/power.jl +++ b/src/power.jl @@ -123,7 +123,7 @@ Return the minimum effect size for some test `T` with significance level `alpha` """ function get_es(T::StatisticalTest; alpha::Real, power::Real, n) f(es) = get_alpha(T; es, power, n) - alpha - initial_value = 0.5 + initial_value = (0, 10) return find_zero(f, initial_value) end @@ -134,6 +134,6 @@ Return minimum sample size `n` for some test `T` with significance level `alpha` """ function get_n(T::StatisticalTest; alpha::Real, power::Real, es::Real) f(n) = get_alpha(T; es, power, n) - alpha - initial_value = 50 + initial_value = (2, 1000) return find_zero(f, initial_value) end