R - Kruskall-Wallis test
HTML-код
- Опубликовано: 21 авг 2024
- R script download (script has been slightly modified (/updated) compared to the video):
rstatisticsand...
Real-life example
Assumptions
Output interpretation
R studio tutorial
Kruskall-Wallis test
A perfect demo! Thank you very much.
This is great. clear short and to the point. I just have one question. what to do when homogeneity p-value is lower than 0.05?
Yes, I have the same question :(
@@gabrielrojas1023 did you find a answer ?????????????
I am new to statistics but someone online told me that you can still do Kruskal-Wallis test even if you do not meet the homogeneity assumption. However the results of the test are weaker without it (can only determine stochastic dominance of median, and not quantiles).. Not entirely sure what that means but that's what I was told haha
Excellent tutorial very clear and easy to follow. I successfully applied this approach to my data - looking at differences in sediment C/N ratio between locations. Thanks very much.
Thank you!! Help me a lot ! Anticipate more video about PCA or CCA interpretation
what could an option for non parametic test of samples with unequal variances?
Thanks. Very useful set of lessons you run here! Liked and subbed
you want P-value of bartlett to be less than 0.05 to run a nonparametric. Your video states that you want p-value to be greater than 0.05. Greater means you use parametric ANOVA, and less than mean you use non-parametric Kruskal wallis. The null for Bartlett is that the variances are equal, so you want to fail to reject null to run parametric, and you want to reject null if you want to use nonparametric.
A bartlett test is used for testing of homogeneity of variances, not for testing normality. Other than that, a bartlett test does assume normality, which is why it should (in this particular case) be replaced by a better suited test, this one slipped through. Script will be updated as such.
thanks a lot, best video.
Recapitulated and Clear.
Thank you for the very nice info. I would like to ask you how would you recommend as a substitute test for a two-way ANOVA if my data is not normally distributed? I have two variables (Temperature and Salinity) and one response variable (settlement). I used the Kruskall-wallis test to compare the settlement in the different groups not considering the interactions.
Would this be a possible solution?
I have the same doubt :/
Fiednman test have you checked?
Very nice and clearly explained
Thank you very much for this helpful video. My question is, I knew as a very first assumption that we have to use (or prefer to use) Kruskal Wallis test when we have a rank/ordinal data (non-parametric), but in here I see an interval data with a relative value (length) and distance in cm (parametric). So I would prefer to use Ona-Way ANOVA as usual. How should we decide at this stage, is there any assumption about this idea (ordinal vs. interval)? Thank you
Normal distribution is not necessary for Kruskall. ( Skewed distributions )
Anova used for normal distribution a.k.a Gaussian.
So understandable
Thank you very much...Very helpful
Hi Great Video I have subscribed. Do you mind if I ask a question please
Very helpful.....Thank you verey much
Thank you
Thank you VERY much
what if the bartlett. test p value is
That depends... You could e.g. first try to transform your data prior to analysis, e.g. log10-transformation, and see if that makes a difference.
I've also looked up online that for Bartlett Test the data must be normally distributed (www.datanovia.com/en/lessons/homogeneity-of-variance-test-in-r/) . I am so confused now.
You are right, this inconsistency slipped through. An alternative would be to investigate residual plots instead. Also don't put too much weight on this assumption: you only need to worry when it's massively off.
Hi, thanks for the video! quick question, I though you could use K-W when the assumption of homoscedasticity was not fulfil, even after log transformation. Is that correct? otherways I am a bit confused about which test to use when there is no normality neither homoscedasticity.
Another question that arises to me is the fact of using Bartlett test to check if there is or not heterogenity. though that Barlett test is suppose to be used when your data is distributed normaly
Thank you in advance for your answer
Hello Irene,
Thanks for your comments.
To answer your first question: homoscedasticity is a prerequisite even for KW (but not normality), that's quite important.
To answer your second question: you are actually right that Bartlett's test is not the best choice with non-normal data, it is slightly more vulnerable to deviations than, for instance, Levene's test. Thanks for pointing that out. I have therefore adapted the script (in the download link) accordingly.
Thank you for your answer and for all changes on the script. Could you advice me about a test which will run with data that does not have homoscedasticity neither normality?
Would it also be appropriate to use a pairwise test, rather than a DunnTest for post hoc comparisons? If not, why is that, please?
Hello, I'm not sure if I understand your question properly (which pairwise test?), but most likely that is not a sound alternative. One has to correct for multiple comparisons, and therefore one cannot simply run multiple pairwise tests.
@@RStatisticsandResearch I mean: pairwise.wilcox.test() with Bonferroni correction method.
My p value in bartlett test come
Sorry, to bother - but after Dunn Test, it is said that Wall Lizard is larger than Viviparous Lizard - This statement is on the basis of Dunn Test or the Boxplot?
Please Guide....!
The Dunn test will tell you which groups are significantly different (p < 0.05), but also the direction of this difference (= the first-line z-value, if positive, then wall lizard is larger than viviparous lizard). The boxplot can be used to visualize this difference, but it does not contain any info on statistical significance.
Thank you, and if the Z value is -ve ?
If I test the affect on pH on bacteria growth in a non-normal distribution, should I make my pH values factors too even though they are continuous, numeric?
You would need a different test for that, as they indeed are continuous variables. A test for group differences does not apply then.
Thank you very very much for this great informative video
Can you provide a peer reviewed publication that says this test requires homogeneity of variance, please?
I thought a Kruskal Wallis was for when homogeneity of variances was not equal. If they are equal, why not a one-way anova?
Why the R have two calls foi dun test ? dunnTest and dunn.test, and this two calls give me different results
I am needing to run a Kruskal wallace test on six groups but having run the Bartlett and the Levene Test it's clear I have unequal variances. So What Test Do I Use Now Please?
When variances are unequal, you can e.g. look into (1) transforming your data prior to analysis , or (2) look for other tests such as Welch's ANOVA
@@RStatisticsandResearch Thank you