Skip to content

Commit

Permalink
hedges.py fix: pooled SD for two measurments
Browse files Browse the repository at this point in the history
  • Loading branch information
remislp committed Feb 10, 2020
1 parent bd73621 commit 90f9296
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dcstats/hedges.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import random
import math
import statistics as pyst
from dcstats.statistics_EJ import simple_stats as mean_SD
from dcstats.statistics_EJ import InverseStudentT

Expand Down Expand Up @@ -125,7 +126,11 @@ def bootstrap_CI (self, repeats, bCA=False):
s_pooled = math.sqrt((n2m * sbr2 ** 2 + n1m * sbr1 ** 2) / (n1m + n2m))

#Hedges' g
biased_d = (mbr2 - mbr1) / s_pooled
# RL: quick fix (probably not very meaningful) for a case of a sample with two measurments only
if s_pooled == 0.0:
biased_d = 0.0
else:
biased_d = (mbr2 - mbr1) / s_pooled

# correction has no influence on the bootstrap distribution
# so apply it later to save multiplications
Expand Down
Binary file modified tests/multi_samples.xlsx
Binary file not shown.

0 comments on commit 90f9296

Please sign in to comment.