Kruskal Wallis Test interpretation
$begingroup$
I am asked to compare following 4 samples.:
$begin{matrix}
G1& G2&G3&G4\
2 & 3& 3 &4\
3 &4 &5& 6\
1 &2& 1& 2\
1& 1& 2 &2\
1 &1 &2& 3\
2 &2 &2& 2\
end{matrix}
$
I did the test and found a H value of 3.755, which with 3 DF is nowhere near significant. However, shouldnt there be a difference between G1 and G4? If i was just to do a rank sum test between G1 and G4 it would be significant.
Does the Kruskal Wallis test not interpret any difference between any group? Or did I just make a mistake in the analysis?
Any help appreciated!
statistics
$endgroup$
add a comment |
$begingroup$
I am asked to compare following 4 samples.:
$begin{matrix}
G1& G2&G3&G4\
2 & 3& 3 &4\
3 &4 &5& 6\
1 &2& 1& 2\
1& 1& 2 &2\
1 &1 &2& 3\
2 &2 &2& 2\
end{matrix}
$
I did the test and found a H value of 3.755, which with 3 DF is nowhere near significant. However, shouldnt there be a difference between G1 and G4? If i was just to do a rank sum test between G1 and G4 it would be significant.
Does the Kruskal Wallis test not interpret any difference between any group? Or did I just make a mistake in the analysis?
Any help appreciated!
statistics
$endgroup$
add a comment |
$begingroup$
I am asked to compare following 4 samples.:
$begin{matrix}
G1& G2&G3&G4\
2 & 3& 3 &4\
3 &4 &5& 6\
1 &2& 1& 2\
1& 1& 2 &2\
1 &1 &2& 3\
2 &2 &2& 2\
end{matrix}
$
I did the test and found a H value of 3.755, which with 3 DF is nowhere near significant. However, shouldnt there be a difference between G1 and G4? If i was just to do a rank sum test between G1 and G4 it would be significant.
Does the Kruskal Wallis test not interpret any difference between any group? Or did I just make a mistake in the analysis?
Any help appreciated!
statistics
$endgroup$
I am asked to compare following 4 samples.:
$begin{matrix}
G1& G2&G3&G4\
2 & 3& 3 &4\
3 &4 &5& 6\
1 &2& 1& 2\
1& 1& 2 &2\
1 &1 &2& 3\
2 &2 &2& 2\
end{matrix}
$
I did the test and found a H value of 3.755, which with 3 DF is nowhere near significant. However, shouldnt there be a difference between G1 and G4? If i was just to do a rank sum test between G1 and G4 it would be significant.
Does the Kruskal Wallis test not interpret any difference between any group? Or did I just make a mistake in the analysis?
Any help appreciated!
statistics
statistics
asked Jan 13 at 15:12
Nicola ZauggNicola Zaugg
91
91
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
I got an $H$ value of $4.1343$ using the R implementation of the Kruskal-Wallis test, for a p-value of $0.2473$, which is not significant (as you said). Like you, when I test G$1$ against G$4$ then I get a much more significant result (p-value $0.0539$).
The reason for the discrepancy is that the Kruskall-Wallis test is automatically correcting for the fact that we are testing multiple hypotheses at the same time. We are testing if there is a difference between the means of $1$ and $2$, and at the same time we are testing if there is a difference between the means of $1$ and $3$, while also testing for a difference between the means of $1$ and $4$, and so on. By just looking at one pair of samples and ignoring the others you are very likely to believe there is a difference just due to random sampling error. With $4$ data sets, at least one pair are quite likely to look different just by random chance, and the Kruskall-Wallis test accounts for this.
An illustrative example from the Wikipedia page on the multiple testing problem:
Suppose the treatment is a new way of teaching writing to students, and the control is the standard way of teaching writing. Students in the two groups can be compared in terms of grammar, spelling, organization, content, and so on. As more attributes are compared, it becomes increasingly likely that the treatment and control groups will appear to differ on at least one attribute due to random sampling error alone.
R code for testing for the two tests that I performed:
g1 = c(2, 3, 1, 1, 1, 2)
g2 = c(3, 4, 2, 1, 1, 2)
g3 = c(3, 5, 1, 2, 2, 2)
g4 = c(4, 6, 2, 2, 3, 2)
kruskal.test(list(g1, g2, g3, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g2, g3, g4)
Kruskal-Wallis chi-squared = 4.1343, df = 3, p-value = 0.2473
Just comparing G$1$ and G$4$:
kruskal.test(list(g1, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g4)
Kruskal-Wallis chi-squared = 3.7158, df = 1, p-value = 0.0539
$endgroup$
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3072089%2fkruskal-wallis-test-interpretation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
I got an $H$ value of $4.1343$ using the R implementation of the Kruskal-Wallis test, for a p-value of $0.2473$, which is not significant (as you said). Like you, when I test G$1$ against G$4$ then I get a much more significant result (p-value $0.0539$).
The reason for the discrepancy is that the Kruskall-Wallis test is automatically correcting for the fact that we are testing multiple hypotheses at the same time. We are testing if there is a difference between the means of $1$ and $2$, and at the same time we are testing if there is a difference between the means of $1$ and $3$, while also testing for a difference between the means of $1$ and $4$, and so on. By just looking at one pair of samples and ignoring the others you are very likely to believe there is a difference just due to random sampling error. With $4$ data sets, at least one pair are quite likely to look different just by random chance, and the Kruskall-Wallis test accounts for this.
An illustrative example from the Wikipedia page on the multiple testing problem:
Suppose the treatment is a new way of teaching writing to students, and the control is the standard way of teaching writing. Students in the two groups can be compared in terms of grammar, spelling, organization, content, and so on. As more attributes are compared, it becomes increasingly likely that the treatment and control groups will appear to differ on at least one attribute due to random sampling error alone.
R code for testing for the two tests that I performed:
g1 = c(2, 3, 1, 1, 1, 2)
g2 = c(3, 4, 2, 1, 1, 2)
g3 = c(3, 5, 1, 2, 2, 2)
g4 = c(4, 6, 2, 2, 3, 2)
kruskal.test(list(g1, g2, g3, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g2, g3, g4)
Kruskal-Wallis chi-squared = 4.1343, df = 3, p-value = 0.2473
Just comparing G$1$ and G$4$:
kruskal.test(list(g1, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g4)
Kruskal-Wallis chi-squared = 3.7158, df = 1, p-value = 0.0539
$endgroup$
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
add a comment |
$begingroup$
I got an $H$ value of $4.1343$ using the R implementation of the Kruskal-Wallis test, for a p-value of $0.2473$, which is not significant (as you said). Like you, when I test G$1$ against G$4$ then I get a much more significant result (p-value $0.0539$).
The reason for the discrepancy is that the Kruskall-Wallis test is automatically correcting for the fact that we are testing multiple hypotheses at the same time. We are testing if there is a difference between the means of $1$ and $2$, and at the same time we are testing if there is a difference between the means of $1$ and $3$, while also testing for a difference between the means of $1$ and $4$, and so on. By just looking at one pair of samples and ignoring the others you are very likely to believe there is a difference just due to random sampling error. With $4$ data sets, at least one pair are quite likely to look different just by random chance, and the Kruskall-Wallis test accounts for this.
An illustrative example from the Wikipedia page on the multiple testing problem:
Suppose the treatment is a new way of teaching writing to students, and the control is the standard way of teaching writing. Students in the two groups can be compared in terms of grammar, spelling, organization, content, and so on. As more attributes are compared, it becomes increasingly likely that the treatment and control groups will appear to differ on at least one attribute due to random sampling error alone.
R code for testing for the two tests that I performed:
g1 = c(2, 3, 1, 1, 1, 2)
g2 = c(3, 4, 2, 1, 1, 2)
g3 = c(3, 5, 1, 2, 2, 2)
g4 = c(4, 6, 2, 2, 3, 2)
kruskal.test(list(g1, g2, g3, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g2, g3, g4)
Kruskal-Wallis chi-squared = 4.1343, df = 3, p-value = 0.2473
Just comparing G$1$ and G$4$:
kruskal.test(list(g1, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g4)
Kruskal-Wallis chi-squared = 3.7158, df = 1, p-value = 0.0539
$endgroup$
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
add a comment |
$begingroup$
I got an $H$ value of $4.1343$ using the R implementation of the Kruskal-Wallis test, for a p-value of $0.2473$, which is not significant (as you said). Like you, when I test G$1$ against G$4$ then I get a much more significant result (p-value $0.0539$).
The reason for the discrepancy is that the Kruskall-Wallis test is automatically correcting for the fact that we are testing multiple hypotheses at the same time. We are testing if there is a difference between the means of $1$ and $2$, and at the same time we are testing if there is a difference between the means of $1$ and $3$, while also testing for a difference between the means of $1$ and $4$, and so on. By just looking at one pair of samples and ignoring the others you are very likely to believe there is a difference just due to random sampling error. With $4$ data sets, at least one pair are quite likely to look different just by random chance, and the Kruskall-Wallis test accounts for this.
An illustrative example from the Wikipedia page on the multiple testing problem:
Suppose the treatment is a new way of teaching writing to students, and the control is the standard way of teaching writing. Students in the two groups can be compared in terms of grammar, spelling, organization, content, and so on. As more attributes are compared, it becomes increasingly likely that the treatment and control groups will appear to differ on at least one attribute due to random sampling error alone.
R code for testing for the two tests that I performed:
g1 = c(2, 3, 1, 1, 1, 2)
g2 = c(3, 4, 2, 1, 1, 2)
g3 = c(3, 5, 1, 2, 2, 2)
g4 = c(4, 6, 2, 2, 3, 2)
kruskal.test(list(g1, g2, g3, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g2, g3, g4)
Kruskal-Wallis chi-squared = 4.1343, df = 3, p-value = 0.2473
Just comparing G$1$ and G$4$:
kruskal.test(list(g1, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g4)
Kruskal-Wallis chi-squared = 3.7158, df = 1, p-value = 0.0539
$endgroup$
I got an $H$ value of $4.1343$ using the R implementation of the Kruskal-Wallis test, for a p-value of $0.2473$, which is not significant (as you said). Like you, when I test G$1$ against G$4$ then I get a much more significant result (p-value $0.0539$).
The reason for the discrepancy is that the Kruskall-Wallis test is automatically correcting for the fact that we are testing multiple hypotheses at the same time. We are testing if there is a difference between the means of $1$ and $2$, and at the same time we are testing if there is a difference between the means of $1$ and $3$, while also testing for a difference between the means of $1$ and $4$, and so on. By just looking at one pair of samples and ignoring the others you are very likely to believe there is a difference just due to random sampling error. With $4$ data sets, at least one pair are quite likely to look different just by random chance, and the Kruskall-Wallis test accounts for this.
An illustrative example from the Wikipedia page on the multiple testing problem:
Suppose the treatment is a new way of teaching writing to students, and the control is the standard way of teaching writing. Students in the two groups can be compared in terms of grammar, spelling, organization, content, and so on. As more attributes are compared, it becomes increasingly likely that the treatment and control groups will appear to differ on at least one attribute due to random sampling error alone.
R code for testing for the two tests that I performed:
g1 = c(2, 3, 1, 1, 1, 2)
g2 = c(3, 4, 2, 1, 1, 2)
g3 = c(3, 5, 1, 2, 2, 2)
g4 = c(4, 6, 2, 2, 3, 2)
kruskal.test(list(g1, g2, g3, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g2, g3, g4)
Kruskal-Wallis chi-squared = 4.1343, df = 3, p-value = 0.2473
Just comparing G$1$ and G$4$:
kruskal.test(list(g1, g4))
Output:
Kruskal-Wallis rank sum test
data: list(g1, g4)
Kruskal-Wallis chi-squared = 3.7158, df = 1, p-value = 0.0539
answered Jan 13 at 17:34


AlexAlex
674412
674412
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
add a comment |
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
The question to the problem is whether there is a significant difference between these samples. Am I Using the correct test then? my answer would be: No due to the test above, but yes when I just compare 1 and 4. I am a bit confused what I need to answer exactly
$endgroup$
– Nicola Zaugg
Jan 13 at 18:12
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
$begingroup$
Your first result, using the Kruskal-Wallis test to see if there were any differences and finding that there were none, is the correct result. The difference between $1$ and $4$ is due to random sampling error and should not be included.
$endgroup$
– Alex
Jan 13 at 18:23
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3072089%2fkruskal-wallis-test-interpretation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown