32

There are differences in the assumptions and the hypotheses that are tested. The ANOVA (and t-test) is explicitly a test of equality of means of values. The Kruskal-Wallis (and Mann-Whitney) can be seen technically as a comparison of the mean ranks. Hence, in terms of original values, the Kruskal-Wallis is more general than a comparison of means: it tests ...


23

You should use Dunn's test$^{*}$. If one proceeds by moving from a rejection of Kruskal-Wallis to performing ordinary pair-wise rank sum tests (with or without multiple comparison adjustments), one runs into two problems: (1) the ranks that the pair-wise rank sum tests use are not the ranks used by the Kruskal-Wallis test; and (2) Dunn's test preserves a ...


18

The output following the Kruskal-Wallis test provides all possible pairwise comparisons (six in the case of four groups). So the one on the first row compares group B with group A, the first on the second row compares group C with group A, etc.). The upper number for each comparison is Dunn's pairwise z test statistic. The lower number is in this example ...


17

Yes, non-significant results are just as important as significant ones. If you are reporting any result, always include the df, test statistic, and p value. And in that case, you should state the exact p-value, rather than generalising to >0.05


15

The Wilcoxon/Kruskal-Wallis test is not for either the mean or median although the median may be closer to what the test is testing. The estimator that is consistent with the test is the Hodges-Lehmann estimator. See http://en.wikipedia.org/wiki/Mann-whitney and http://en.wikipedia.org/wiki/Hodges%E2%80%93Lehmann_estimate . In R you can do the ...


15

No, you should not use the Mann-Whitney $U$ test in this circumstance. Here's why: Dunn's test is an appropriate post hoc test* following rejection of a Kruskal-Wallis test. If one proceeds by moving from a rejection of Kruskal-Wallis to performing ordinary pair-wise rank sum (i.e. Wilcoxon or Mann-Whitney) tests, then two problems obtain: (1) the ranks ...


13

The Mann-Whitney or Wilcoxon test compares two groups while the Kruskal-Wallis test compares 3. Just like in the ordinary ANOVA with three or more groups the procedure generally suggested is to do the overall ANOVA F test first and then look at pairwise comparisons in case there is a significant difference. I would do the same here with the nonparametric ...


13

Understanding how these tests differ requires understanding the actual test statistics themselves. For example, dunn.test provides Dunn's (1964) z test approximation to a rank sum test employing both the same ranks used in the Kruskal-Wallis test, and the pooled variance estimate implied by the null hypothesis of the Kruskal-Wallis (akin to using the pooled ...


12

The answer is Friedman test. It is nonparametric and as you can see on Wikipedia, there is also very similar example as yours ("n wine judges each rate k different wines. Are any wines ranked consistently higher or lower than the others?"). See R package pgirmess and friedman.test() function that takes datamatrix as input. Note that if your null hypothesis ...


12

The Kruskal-Wallis test is said to test whether the median is the same in every group. According to that simple rule, you should report the median, which is my answer to your question. However, this gives me the occasion to show that the KW is not really a test of the median. The alternative hypothesis of the test is not that one of the distributions has a ...


12

kruskal.test applies a correction for ties as described in this Wikipedia article (point 4): A correction for ties if using the short-cut formula described in the previous point can be made by dividing H by $1 - \frac{\sum_{i=1}^G (t_i^3 - t_i)}{N^3-N}$, ... Continuing from your code: TIES <- table(activity) H / (1 - sum(TIES^3 - TIES)/(length(...


11

I agree with Michael Chernick's answer, but think that it can be made a little stronger. Ignore the 0.05 cutoff in most circumstances. It is only relevant to the Neyman-Pearson approach which is largely irrelevant to the inferential use of statistics in many areas of science. Both tests indicate that your data contains moderate evidence against the null ...


11

No, it is not a valid nonparametric alternative. The rank sum test (either original Wilcoxon flavor, or New Improved Mann-Whitney $U$ varieties): ignore the rankings used by the Kruskal-Wallis test, and do not employ pooled variance for the pairwise tests. See, for example, Kruskal-Wallis Test and Mann-Whitney U Test. (Also the pairwise.wilcox.test seems ...


10

You are looking for Dunn's test (or, say, the Conover-Iman test). This is very much like a set of pairwise rank sum tests, but Dunn's versions (1) accounts for the pooled variance implied by the null hypothesis, and (2) retains the ranking used to conduct the Kruskal-Wallis test. Performing garden variety Wilcoxon/Mann-Whitney rank sum tests ignores with ...


10

One can only hope that when you applied the Shapiro-Wilk test you did it to the residuals, rather than to the untransformed response, because the latter approach is wrong. Indeed it's often quoted, as you have here, that the assumption is that the data are normal and that's just unclear nonsense. It's the conditional $Y$, the residuals, that have to be ...


9

The generalization of the Kruskal-Wallis test is the proportional odds ordinal logistic model. Such a model can provide the multiple degree of freedom overall test as you get with K-W but also can provide general contrasts (on the log odds ratio scale) including pairwise comparisons.


9

Nice question! Let's clear up some potential confusion, first. Dunn's test (Dunn, 1964) is precisely that: a test statistic which is a nonparametric analog to the pairwise t test one would conduct post hoc to an ANOVA. It is similar to the Mann-Whitney-Wilcoxon rank sum test, except that (1) it employs a measure of the pooled variance that is implied by the ...


8

Perhaps not surprising that you got disparate results since (ahem): the Mann-Whitney rank sum test is not an appropriate post hoc pairwise test for the Kruskal-Wallis omnibus test. The rank sum test: Ignores the rankings used to conduct the Kruskal-Wallis test Does not account for the pooled variance implied by the null hypothesis of the Kruskal-Wallis ...


8

What you should always keep in mind, is that The Difference Between “Significant” and “Not Significant” is not Itself Statistically Significant -- there is a nice paper with this title by Gelman and Stern, which I link to here, but the idea is very simple. Here is how they start explaining it: Consider two independent studies with effect estimates and ...


8

You would use the Bonferroni for a one-way test. But let's be clear: You would not use the Bonferroni adjustment on the Kruskal-Wallis test itself. The Kruskal-Wallis test is an omnibus test, controlling for an overall false-positive rate. You would use the Bonferroni for post hoc Dunn's pairwise tests. Indeed, Dunn introduced the "Bonferroni" adjustment. ...


8

The KW test (also the Mann-Whitney U-test) is essentially always a test for stochastic dominance. What that means is it is testing to see if there exists at least one group such that you would typically get a larger (lesser) value from it than the rest if you drew a value at random from each. People assume this means that one median or mean must be ...


8

Thanks for posting the data. Some exploration and analysis lead to the following suggestions. The data show some moderate outliers. There is always a danger of overinterpreting small samples, meaning that the gaps might well be filled in by other values in a larger sample. The idea of a reciprocal transformation, mapping speed to some measure of time ...


7

It appears that your data can only take on positive values. In this case, the hypothesis of normality is often rejected. Normally distributed random variables range from positive to negative infinity, so only positive values would violate this. You could try taking the log of the observations and seeing whether these are normally distributed. If your data ...


7

A unifying generalization of Kruskal-Wallis/Wilcoxon is the proportional odds model, which admits general contrasts with either pointwise or simultaneous confidence intervals for odds ratios. This is implemented in my R rms package's orm and contrast.rms functions.


7

I think one could write a whole book dealing exclusively with your question (and I am definitely not qualified to write it). So without any attempt at providing a comprehensive answer, here are some points that can hopefully be helpful. Confirmatory vs. exploratory approach to analysis As you note yourself, you have a very rich dataset and you can test a ...


7

In both cases 12 appears when approximating the distribution of the test statistic with a normal and chi-square respectively because the statistic must first be written in a standardized form (if you were performing a permutation test these constants would be unnecessary). With continuous data, the ranks from $1$ to $n$ are used, and the variance of a ...


7

Wilcoxon signed-rank test just takes in account the signs of the differences of values of every pair of data, and it doesn't take in account how large is such a difference. Therefore, the only thing that matters in your data is that all values in one group are larger than the matching values in the other group. That is, the only thing a Wilcoxon text will ...


7

If you are publishing a paper in the open literature, you should definitely report statistically insignificant results the same way you report statistical significant results. Otherwise you contribute to underreporting bias.


6

If Y is meant to be a grouping variable, the p-value in R is around 0.45 > kruskal.test(x~y) Kruskal-Wallis rank sum test data: x by y Kruskal-Wallis chi-squared = 0.5622, df = 1, p-value = 0.4534 But it makes no difference whether that 35 is set to 13 or 35 or 1300 - the p-value is exactly the same. It is clearly robust to outliers. With ...


6

First, one note. Like Kruskal-Wallis, Jonckheere-Terpstra is generally not a test of medians. It is a test of distributional "locations", or stochastic prevalence. It can give significant result even if medians are equal. Now, for your test (let us honour your medians as locations). The test is highly significant because there is expressed trend in 0.1387, ...


Only top voted, non community-wiki answers of a minimum length are eligible