13.14
O teste de Kruskal-Wallis, também conhecido como teste H de Kruskal-Wallis, serve como uma alternativa não paramétrica à ANOVA unidirecional, oferecen…
O teste de Kruskal-Wallis, ou H, é uma alternativa não paramétrica à ANOVA de uma via. Ele testa efetivamente a hipótese nula de que três ou mais populações têm medianas idênticas.
Considere o conjunto de dados sobre as vendas de uvas vermelhas, verdes e pretas de um supermercado.
Como determinar se as três amostras são originárias de populações com a mesma mediana de vendas?
Para testar essa afirmação, todas as amostras são inicialmente mescladas para atribuir classificações. Em seguida, a soma das classificações para cada amostra é calculada de forma independente.
A estatística de teste, H, é derivada usando uma fórmula que quantifica a variância entre as somas de classificação.
Nesse cenário, o valor de H segue a distribuição qui-quadrado, sendo os graus de liberdade um a menos que o número total de amostras, que é dois.
Nesse nível de graus de liberdade, o valor crítico é determinado a partir de sua tabela correspondente em um nível de significância escolhido, como 0,05.
Dado que o valor H calculado é menor que o valor crítico, a hipótese nula, sugerindo que as amostras vêm de populações com medianas equivalentes, não pode ser rejeitada.
View the full transcript and gain access to JoVE Core videos
Q1: What is the Kruskal-Wallis test used for?
The Kruskal-Wallis test, or H test, is a nonparametric alternative to one-way ANOVA that tests whether three or more independent groups have identical medians. It's particularly valuable when data doesn't meet the normal distribution assumption required by parametric tests, making it ideal for ordinal data or when variances across groups are unequal.
Q2: How does the Kruskal-Wallis test calculate its test statistic?
The test merges all samples and assigns ranks to each data point across the entire dataset. The sum of ranks for each sample is calculated independently, then used in a formula to derive the H statistic, which quantifies variance among rank sums. This H value follows the chi-square distribution with degrees of freedom equal to one less than the number of groups.
Q3: What are the key assumptions of the Kruskal-Wallis test?
The Kruskal-Wallis test requires independent observations, identical distribution shapes and scales across groups, and ordinal or continuous data. Unlike parametric tests such as one-way ANOVA, it doesn't assume normal distribution or equal variances, making it more robust for non-normally distributed datasets and reducing the impact of outliers.
Q4: When should you use the Kruskal-Wallis test instead of ANOVA?
Use the Kruskal-Wallis test when comparing medians across three or more groups with non-normal data, unequal variances, or ordinal measurements. It's advantageous in psychology for comparing therapeutic approaches, in medicine for evaluating non-normally distributed treatment outcomes, and in environmental science for comparing ecological measurements across different sites.
Q5: How do you interpret the Kruskal-Wallis test results?
Compare the calculated H statistic to the critical value from the chi-square distribution table at your chosen significance level, such as 0.05. If H is lower than the critical value, you cannot reject the null hypothesis that samples originate from populations with equivalent medians. If H exceeds the critical value, reject the null hypothesis.
Q6: Why does the Kruskal-Wallis test focus on ranks instead of means?
By using ranks rather than actual data values, the Kruskal-Wallis test reduces the impact of outliers and extreme values that could distort parametric analyses. This rank-based approach makes the test robust against non-normal distribution shapes and violations of homogeneity assumptions, providing valid conclusions even when data doesn't conform to traditional statistical requirements.
Q7: What is the relationship between the Kruskal-Wallis test and other nonparametric tests?
The Kruskal-Wallis test is part of a broader family of nonparametric methods used when parametric assumptions fail. For paired or matched data, the friedman two way analysis of variance by ranks serves as an alternative. These tests collectively provide researchers with flexible tools for analyzing diverse data types without stringent distributional assumptions.