options ls = 80 ; data tab312 ; input treatment y @@ ; cards ; 1 6.08 1 22.29 1 7.51 1 34.36 1 23.68 2 30.45 2 22.71 2 44.52 2 31.47 2 36.81 3 32.04 3 28.03 3 32.74 3 23.84 3 29.64 ; * ------ the following printing, ranking, and proc means can be used to calculate KW or KW(VW) by hand ----------------- ; proc sort data = tab312 ; by y ; proc print data = tab312 ; run ; proc rank data = tab312 normal = vw out = ranktab312 ; var y ; ranks rkvwy ; run ; proc means data = ranktab312 ; var rkvwy ; proc means data = ranktab312 ; class treatment ; var rkvwy ; run ; proc print ; run ; * ----------------------------------------------------------------- ; * the Kruskal-Wallis test (asymptotic and permutation) from Proc NPAR1WAY ; proc npar1way data = tab312 wilcoxon ; class treatment ; var y ; exact wilcoxon / n = 2000 ; run ; * the Kruskal-Wallis test (asymptotic and permutation) from Proc NPAR1WAY, using van der Waerden scores ; proc npar1way data = tab312 vw ; class treatment ; var y ; exact vw / n = 2000 ; run ; data tab323 ; input product y @@ ; cards ; 1 4 1 5 1 3 1 4 1 5 1 5 1 2 2 3 2 4 2 5 2 2 2 3 2 1 2 1 2 2 3 2 3 1 3 1 3 2 3 1 3 3 ; * the Kruskal-Wallis test (asymptotic and permutation) from Proc NPAR1WAY, automatically adjusts for ties ; proc npar1way data = tab323 wilcoxon ; class product ; var y ; exact wilcoxon / n = 2000 ; run ;