Re: Kruskal-Wallis critical values



In order to have a glimpse of the errors provided from the use of the Chi-squared critical values on the Kruskal-Wallis ONE-WAY ANOVA test we performed a few calculations.

a)__k = 4, j = 4 (four samples each one with 4 values)
__(Exact__________= 7.21, 9.25)
__C.V´s from chi^2 = 7.815 (95%), 11.34(99%)
providing the Significance Levels = 3.35%, 0.09%

b)__k = 6, j = 10
__(Exact__________= 10.75, 14.20 )
__C.V´s from chi^2 = .11.07 (95%), 15.09 (99%)
Significance Levels = 4.36%, 0.65%.

It seems that from this conditions upwards we can envisage without too much risk the use of the chi^2 values for 95% confidence level, the 99% should not even at this point. They could be useful, however special care must be exercised.

________licas (Luis A. Afonso)


REM "ANUBIS"
CLS
DIM w(8001)
PRINT " KRUSKAL - WALLIS critical values";
PRINT " DISCRETE ANALYSIS "
INPUT " K = number of classes "; k
INPUT " ic = number of items per class "; ipc
N = k * ipc
PRINT " CHISQUARED crit. val. ";
INPUT " 95% , 99% "; CVCHI(1), CVCHI(2)
PRINT " MONTE CARLO ones (shorter) ";
INPUT " 95% , 99% "; MC(1), MC(2)
tot = (1 + k * ipc) / 2 * k * ipc
DIM rk(tot)
rpc = tot / k
vv = 1000000
FOR v = 1 TO vv: LOCATE 6, 50
PRINT USING "###########"; vv - v
RANDOMIZE TIMER
FOR ii = 1 TO N: rk(ii) = ii: NEXT ii
FOR jj = 1 TO k: s(jj) = 0: NEXT jj
uuu = 0
FOR class = 1 TO k - 1
s(class) = 0
FOR j = 1 TO ipc
2 jj = INT(k * ipc * RND) + 1
IF rk(jj) < 0 THEN GOTO 2
s(class) = s(class) + jj
rk(jj) = -1E+10
NEXT j: uuu = uuu + s(class)
NEXT class
s(k) = tot - uuu
REM k-w statistics
a = 12 / (N * (N + 1))
yu = 0
FOR ik = 1 TO k
yu = yu + s(ik) * s(ik) / ipc: NEXT ik
b = 3 * (N + 1)
q = a * yu - b
IF q > MC(1) THEN lg(1) = lg(1) + 1
IF q > MC(2) THEN lg(2) = lg(2) + 1
IF q >= CVCHI(1) THEN ll(1) = ll(1) + 1
IF q >= CVCHI(2) THEN ll(2) = ll(2) + 1
uy = v / 50000: uyy = INT(v / 50000)
IF uy <> uyy THEN GOTO 10
LOCATE 10, 50
PRINT USING "#.#### #.#### "; lg(1) / v; lg(2) / v
LOCATE 11, 50
PRINT USING "#.#### #.#### "; ll(1) / v; ll(2) / v
10 NEXT v: END
.