2
$\begingroup$

The Kruskal-Wallis Test effect size can be calculated based on the formulae from the article,

once the Kruskal-Wallis H-test has been computed, the epsilon-squared estimate of effect size can be calculated

enter image description here

However, the effect size that I currently obtained by using the formulae above (with K-W Test statistic value using Python's scipy.stats.kruskal) is greater than 1.

from scipy import stats
n = len(X_train)
k = X_train["type_call"].nunique()
result = stats.kruskal(X_train["type_call"].astype("category").cat.codes, y_train)

print("size:", n)
print("number of groups:", k)
print("KW result:", result)
print("effect size:", result[0]/(len(X_train) - 1)) # simplify formulae

# Output
size: 28047
number of groups: 4
KW result: KruskalResult(statistic=43767.1470692367, pvalue=0.0)
effect size: 1.560548636855049

Shouldn't the effect size between the value of 0 and 1, where 0 indicates no relationship and 1 indicates strong relationship?

EDIT: I also tried using an online calculator to calculate the effect size and obtained the same result as my Python code.

enter image description here

$\endgroup$
1
  • $\begingroup$ "Shouldn't the effect size between the value of 0 and 1, where 0 indicates no relationship and 1 indicates strong relationship?" Why do you believe that? $\endgroup$
    – Firebug
    Commented Aug 30, 2023 at 7:31

0