From 516bd7ddd17f2faaf894790f7c35d9969e2b9792 Mon Sep 17 00:00:00 2001 From: Jason Christopherson Date: Wed, 1 May 2024 05:30:15 -0500 Subject: [PATCH] Clean up --- src/fstats_hypothesis.f90 | 7 ++++--- tests/fstats_statistics_tests.f90 | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fstats_hypothesis.f90 b/src/fstats_hypothesis.f90 index 98cabf7..54f3815 100644 --- a/src/fstats_hypothesis.f90 +++ b/src/fstats_hypothesis.f90 @@ -43,12 +43,13 @@ pure function confidence_interval_scalar(dist, alpha, s, n) result(rst) !! The result. ! Local Variables - real(real64) :: x + real(real64) :: x, dn ! Process - x = 1.0d0 - alpha / 2.0d0 + dn = real(n, real64) + x = 1.0d0 - 0.5d0 * alpha rst = dist%standardized_variable(x) - rst = rst * s / sqrt(real(n, real64)) + rst = rst * s / sqrt(dn) end function ! ------------------------------------------------------------------------------ diff --git a/tests/fstats_statistics_tests.f90 b/tests/fstats_statistics_tests.f90 index 1d8f5ea..687fade 100644 --- a/tests/fstats_statistics_tests.f90 +++ b/tests/fstats_statistics_tests.f90 @@ -639,7 +639,7 @@ function confidence_interval_test_1() result(rst) logical :: rst ! Variables - real(real64), parameter :: alpha = 2.0d0 + real(real64), parameter :: alpha = 0.05d0 real(real64), parameter :: tol = 1.0d-3 real(real64), parameter :: t20 = 2.086d0 real(real64), parameter :: t10 = 2.228d0