The Kruskal–Wallis one-way analysis of variance by ranks is a non-parametric method for testing whether samples originate from the same distribution. It is used for comparing more than two samples that are independent, or not related.
Questions tagged [kruskal-wallis]
102 questions
1
vote
1 answer
Which post-hoc test should I conduct after doing a Kruskal-Wallis?
I have a long dataset (N=499). From which I'm comparing how an index behaves with 8 different treatments (with different number of samples in each treatment).
I already did a Kruskal-Wallis and it was significant (p value < 2.2e-16).
Now, for the…

Julián Caviedes
- 11
- 1
- 3
1
vote
2 answers
kruskal-wallis contrast test in r
All,
I would like to perform the equivalent of TukeyHSD on the rank ordering median shift test that such as kruskal wallis
X=matrix(c(1,1,1,1,2,2,2,4,4,4,4,4,1,3,6,9,4,6,8,10,1,2,1,3),ncol=2)
anova=aov(X[,2]~factor(X[,1]))
TukeyHSD(anova)
## Tukey…

Rik
- 1,870
- 3
- 22
- 35
0
votes
1 answer
Compact letter display for kruskal- wallis Dunn post-hoc test on R
This code is working but it uses Fisher LSD test or I need compact letter display for kruskal-wallis Dunn post hoc test. Does anyone have a solution ?
library(agricolae)
kruskal_cld <- kruskal(MR$hauteur, MR$distance, group=TRUE,…

Pauline Lefranc
- 11
- 2
0
votes
0 answers
how to run a Kruskal-Wallis Test in R, with 3 columns of data to include
using R to run a Kruskal-Wallis test to see if there is a difference between 4 species plot counts, over time.
Code I'm using is:-
kruskal.test(Plot_count$SPIECES ~ Time2, data = AMO_data_long)
But don't trust the results as appear to only test if…

Alex22
- 1
0
votes
0 answers
Kruskal-Wallis test using gtsummary package
I tried to run the Kruskal Wallis test for multiple variables at once, but I couldn't. I want to display the mean±SD in the table instead of the median(IQR) similar to what in this image
enter image description here
Here is my data:
df1<-…

Esraa Alfadul
- 1
- 2
0
votes
1 answer
Why does Dunn's post hoc test & CDL output shows different CLD for two treatments with the same mean?
I've been working with a Kruskal wallis non-parametric test in R and following it up with Dunn's multiple comparison's test. Looking at the results of glyphosate H&S(abc) comparisons with others it is showing as not significantly different from any…

E10
- 13
- 4
0
votes
1 answer
Problem using dplyr and kruskal.test on the iris dataset
Here is the problem with the iris dataframe. I´m trying to run a kruskal.test of each variable against the species.
library(dplyr)
for (col in colnames(iris)[1:ncol(iris)-1]) {
iris %>%
group_by(Species) %>%
summarise(
zone=col,
…

david
- 805
- 1
- 9
- 21
0
votes
0 answers
I am getting different results using the kruskal.test if I use the formula - kruskal.test(Response ~ Group, data) vs. comparing indiv. columns
While using R, if I use the formula in kruskal.test:
kruskal.test(Response~Group, data = data)
I am getting significant results (p = 0.018). However, if the data is arranged differently and I just compare the 5 columns:
kruskal.test(a,b,c,d,e)
I…
0
votes
0 answers
Dealing with missing values for Kruskal-Wallis test
Is there a way to deal with missing values for Kruskal-Wallis test, such as multiple imputation instead of just omitting the rows containing NAs? If anyone knows how to do this, please let me know.
I found an R package multkw.m: Multivariate…
0
votes
0 answers
Kruskal Wallis test - switching response and input variables
I am trying to establish if there is an association between two variables. My Outcome Variable, sum_anx_7 , indicates the level of Anxiety. My Input variable is the number of traumas experience in childhood, ACE_FREQ_SUM_agg.
summary(dt$sum_anx_7)
…

Nneka
- 1,764
- 2
- 15
- 39
0
votes
0 answers
Am I able to get a specific P-value to see where the significance lies?
So these are the survey results. I have tried to do pairwise testing (pairwise.wilcox.test) for these results collected in Spring and Autumn for these sites. But I can't get a specific P -value as to which site has the most influence.
This is the…

Liblob
- 1
- 1
0
votes
3 answers
If/For loop: If shapiro-Wilk is >0.05, perform one-way ANOVA, if <0.05 perform Kruskal-wallis in r
Programmatically select/run group comparisons (incl post-hoc)
I would like to perform a loop in r, where if the p value of a shaprio-wilk test is less than 0.05, It performs a kruskall-wallis test, but if it is greater than 0.05, a one-way ANOVA is…

MM1
- 478
- 15
0
votes
0 answers
How to perform a Kruskal-Wallis test with interaction terms in R?
I am doing some analysis on R. I am trying to test capture rates against season, habitat, and species.
The data is non-parametric so I am able to use kruskal.test(`Capture rate` ~ Season, data = data) for example to check for the significance of…

Aditya Ganesh
- 13
- 6
0
votes
1 answer
Kruskal-Wallis statistic & p-value matrix loop for data subsets in R
Consider a dataset "trees" which has several factors and two numerical continuous variables. Two of these variables, plot.type (with classes "one", "ten", "non") and demog (with classes "seed", "sap", "adult"), are used to subset the data. For every…

italia
- 25
- 3
0
votes
0 answers
Function that will add a kruskal-wallis and dunn test to a custom ggplot
I'm writing a function to add a kruskal-wallis test AND dunn test to ggplot. In particular, I would like the following function to also work with tibbles but it only works for…