14-3 Lesson. Kruskal-Wallis H test
Recommended Article : 【Statistics】 Lesson 14. Statistical Tests
1. Overview
2. Method
1. Overview
⑴ Definition
① A test method for comparing distributions of three or more groups
② Used for the same purpose as one-way ANOVA in parametric methods
③ Tests whether the group median is the same, not the mean
④ Sample sizes may vary across groups
⑵ (Reference) Choice of Test Method
① Single sample
○ Parametric test : Single sample T-test
○ Non-parametric test : Sign test, Wilcoxon signed rank test
② Two samples (paired samples) : Essentially the same as a single sample
○ Parametric test : Paired sample T-test
○ Non-parametric test : Sign test, Wilcoxon signed rank test
③ Two samples (independent samples)
○ Parametric test : Independent sample T-test
○ Non-parametric test : Wilcoxon rank sum test
④ Analysis of variance
○ Parametric test : ANOVA
○ Non-parametric test : Kruskal-Wallis test
⑤ Randomness
○ Non-parametric test : Run test
⑥ Correlation analysis
○ Pearson correlation coefficient
○ Spearman rank correlation coefficient
2. Method
⑴ Example sample
Figure. 1. Example sample
⑵ Step 1. Set up hypotheses
① Null hypothesis H0 : Medians of each group are the same
② Alternative hypothesis H1 : At least one group’s median is different
⑶ Step 2. Assign ranks to 16 data points (four data points from each of four sample groups)
⑷ Step 3. Define the test statistic H as follows
⑸ Step 4. Apply H to the chi-squared test (however, degrees of freedom n-1 = 3)
⑹ Rejection region for significance level α
① If H ≥ h(α, k, (1, 2, ∙∙∙, m)), then reject H0
② h(α, k, (1, 2, ∙∙∙, m)) is the upper 100α percentile of H satisfying P(H ≥ h(α, k, (1, 2, ∙∙∙, m)))
⑺ RStudio
kruskal.test(y ~ x, data = my_data)
Posted : 2019.08.24 00:58