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
2
votes
2 answers
R: Kruskal-Wallis test in loop over specified columns in data frame
I would like to run a KW-test over certain numerical variables from a data.frame, using one grouping variable. I'd prefer to do this in a loop, instead of typing out all the tests, as they are many variables (more than in the example…

RmyjuloR
- 369
- 1
- 4
- 13
2
votes
0 answers
How to control method of ranking for Kruskal-Wallis test in R?
In my experiments I tried different set ups to balance the distribution between two tasks. Each set up was run 32 times. I got the following task distributions [ratio from 0 to 1 of tasktype1/(tasktype1+tasktype2)]:…

Basiti
- 143
- 1
- 11
2
votes
1 answer
create vectors for Kruskal-Wallis H-test python
I have dataset as below
df = pd.DataFrame({'numbers':range(9), 'group':['a', 'b', 'c']*3})
group numbers
0 a 0
1 b 1
2 c 2
3 a 3
4 b 4
5 c 5
6 a 6
7 b 7
8 c 8
i want to create vectors
a = [0, 3, 6]
b = [1, 4,…

Edward
- 4,443
- 16
- 46
- 81
2
votes
2 answers
How to deal with missing values in Kruskal-Wallis test in Matlab?
The Matlab documentation seems unclear about how to ignore missing data when using kruskalwallis, the Kruskal-Wallis (or any other related) test. The same goes for unequal group size.

user3503398
- 45
- 5
1
vote
1 answer
What is the quickest way to apply a statistical analysis such as Kruskal-Wallis from scipy module in python to an entire polars dataframe?
I want to apply Kruskal-Wallis statistical analysis on every numeric column of polars dataframe & return a new dataframe where every column holds the result of the KW.
My dataframe consisting of a large number of rows & columns looks like…

megha
- 23
- 4
1
vote
0 answers
Performing a Kruskal-Wallis test
I'm trying to understand if there is a statistical difference between Policy support scores (PS_score) and Income. I have never done one before so I'm hoping someone can see if I have done it correctly?
Also, if there is anything else I should do to…

Lucy Larner
- 11
- 1
1
vote
1 answer
For loop in R: error in model.frame.default()
I'm quite new to loops so please be patient with me :)
I have calculated alpha indices (Observed, Shannon, InvSimpson, Evenness) for which I want to perform a Kruskal-Wallis statistical test with the variable Month of my table.
My table (df) looks…

sophiethomas
- 63
- 6
1
vote
1 answer
Pairwise comparisons with weights in R
I ran a weighted Kruskal Wallis test using the survey package in R.
The result shows that there is a significant difference between groups, but does not specify between which ones. Therefore, I´d like to follow up with weighted pairwise comparisons…

seb-29
- 51
- 2
1
vote
0 answers
same data gives different p-values for kruskal test
I've defined 3 variables that are " x, y and z".
Tried to kruskal test these independent variables.
P-Value comes out different in python and r.
Have any ideas?
in python
from scipy import stats
import numpy as np
x = np.array([22.293, 23.621,…

Joseph_Wesleyan
- 37
- 6
1
vote
0 answers
Compact letter display after Kruskal-Wallis-Test
I'm trying to evaluate some data for my thesis. I can use R to build a boxplot and conduct the statistical test just fine, and I can do the compact letter display manually... but this time I simply have too much data to do it this way. I'm plotting…

Liz
- 11
- 1
1
vote
1 answer
Function to Conduct a Kruskal Wallis Tests for Multiple Comparison of Variables using R
Issue:
I have a dataset that doesn't meet the assumptions to conduct an ANOVA, so I need to conduct a non-parametric alternative such as the Kruskal Wallis test. Overall, I have seven parameters and I want to conduct multiple pairwise comparisons…

Alice Hobbs
- 1,021
- 1
- 15
- 31
1
vote
1 answer
Getting pairwise effect sizes
I am trying to get pairwise comparisons of effect sizes. I can do this with coh_d, however, it gives me repeat comparisons. For example, in the following code, setosa vs. versicolor is the same as versicolor vs. setosa (apart from the flipped…

hugh_man
- 399
- 1
- 6
1
vote
0 answers
Test differences in multimodal distributions for different groups in R or Python
I am analyzing data from 3 different gait speeds. For each group/speed, I am determining specific value called "angle". Each group has different sample size. So, I need to compare multimodal distributions and I would like to statistically test…

Dori
- 53
- 4
1
vote
1 answer
Trying to do a Kruskall Wallis post hoc test in python but stats are different?
I'm struggling to figure this. I'm new to python coming from an SPSS background. Essentially once you've done a Kruskal Wallis test and it returns a low p-value, the correct procedure is to do a post hoc Dunn test. I've been struggling to figure out…

tankgirl2810
- 11
- 1
1
vote
1 answer
Kruskal-wallis in R
I have tried to perform the Kruskal-Wallis test, but I am not sure if the data is ordered correctly, therefore, I do not know if the result is correct.
I still do not know how to verify that it is correct, I do not know if you can help me identify…

loreniaolivas
- 11
- 1
- 2