Kruskal Wallis R v SAS

Kruskal-Wallis: R and SAS

From the individual R and SAS pages, performing the Kruskal-Wallis test in R using:

kruskal.test(Sepal_Width~Species, data=iris_sub)

and in SAS using:

proc npar1way data=iris_sub wilcoxon;
class Species;
var Sepal_Width;
exact;
run;

produced the same results for the test statistic and asymptotic p-value.

There is a difference between languages in that SAS provides the EXACT option to easily output the exact p-value, where R does not seem to have an equivalent. A Monte Carlo permutation test may offer an alternative to the exact test on R. The coin package could help in implementing this.