Glitch in Kruskal-Wallis test?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Glitch in Kruskal-Wallis test?

JLfish
Hi everyone,
I have been running a K-W test with the attached data, PupMort1. My code:
kruskal.test(Prop~Temp,data=PupMort1)
However, I found that I get the exact same result when I change the x-values, as
in the attached data PupMort2.
Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp
Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp
Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
Does anybody know why this is happening?
Thank you!
Jenny
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

PupMort1.txt (91 bytes) Download Attachment
PupMort2.txt (71 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Glitch in Kruskal-Wallis test?

Michael Dewey-3
Dear Jenny

What exactly do you think you are testing here? You are telling K-W you
have seven groups each with a single value which is not the usual
situation for K-W.

Michael

On 22/12/2018 04:58, Jenny Liu wrote:

> Hi everyone,
> I have been running a K-W test with the attached data, PupMort1. My code:
> kruskal.test(Prop~Temp,data=PupMort1)
> However, I found that I get the exact same result when I change the x-values, as
> in the attached data PupMort2.
> Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp
> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp
> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Does anybody know why this is happening?
> Thank you!
> Jenny
>
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Glitch in Kruskal-Wallis test?

JLfish
Hi Michael,

Thank you for your reply! I'm testing the difference in proportions. Temp
is temperature, and Prop is the proportion of insect pupae that survived at
that temperature. I was told by a statistician that the K-W was appropriate
for testing proportions, but perhaps you know of an alternative? I have
already tested for heteroscedasticity using the Breusch-Pagan test.

Thanks again,
Jenny



On Dec 22, 2018 7:38 AM, "Michael Dewey" <[hidden email]> wrote:

Dear Jenny

What exactly do you think you are testing here? You are telling K-W you
have seven groups each with a single value which is not the usual
situation for K-W.

Michael


On 22/12/2018 04:58, Jenny Liu wrote:
> Hi everyone,
> I have been running a K-W test with the attached data, PupMort1. My code:
> kruskal.test(Prop~Temp,data=PupMort1)
> However, I found that I get the exact same result when I change the
x-values, as
> in the attached data PupMort2.
> Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp

> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp

> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Does anybody know why this is happening?
> Thank you!
> Jenny
>
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Glitch in Kruskal-Wallis test?

David Carlson
You may need to spend some more time with the statistician who needs to see your data. It is not clear if you have a two sample test or a paired sample test. Kruskall-Wallis expects data for each observation, not grouped data. Without the observations, the test cannot compute the sample size and the degrees of freedom. You have run kruskal.test separately on each sample. The kruskal.test is designed for comparing two or more samples.

----------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77843-4352

-----Original Message-----
From: R-help <[hidden email]> On Behalf Of Jenny Liu
Sent: Saturday, December 22, 2018 7:10 AM
To: Michael Dewey <[hidden email]>
Cc: [hidden email]
Subject: Re: [R] Glitch in Kruskal-Wallis test?

Hi Michael,

Thank you for your reply! I'm testing the difference in proportions. Temp
is temperature, and Prop is the proportion of insect pupae that survived at
that temperature. I was told by a statistician that the K-W was appropriate
for testing proportions, but perhaps you know of an alternative? I have
already tested for heteroscedasticity using the Breusch-Pagan test.

Thanks again,
Jenny



On Dec 22, 2018 7:38 AM, "Michael Dewey" <[hidden email]> wrote:

Dear Jenny

What exactly do you think you are testing here? You are telling K-W you
have seven groups each with a single value which is not the usual
situation for K-W.

Michael


On 22/12/2018 04:58, Jenny Liu wrote:
> Hi everyone,
> I have been running a K-W test with the attached data, PupMort1. My code:
> kruskal.test(Prop~Temp,data=PupMort1)
> However, I found that I get the exact same result when I change the
x-values, as
> in the attached data PupMort2.
> Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp

> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp

> Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> Does anybody know why this is happening?
> Thank you!
> Jenny
>
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Glitch in Kruskal-Wallis test?

Bert Gunter-2
... Moreover, you should not analyze proportions in this way, which treats
.5 = 2/4 or .5 = 2000/4000 identically. As David said, you need to work
with a statistician.

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Dec 22, 2018 at 7:32 AM David L Carlson <[hidden email]> wrote:

> You may need to spend some more time with the statistician who needs to
> see your data. It is not clear if you have a two sample test or a paired
> sample test. Kruskall-Wallis expects data for each observation, not grouped
> data. Without the observations, the test cannot compute the sample size and
> the degrees of freedom. You have run kruskal.test separately on each
> sample. The kruskal.test is designed for comparing two or more samples.
>
> ----------------------------------------
> David L Carlson
> Department of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
> -----Original Message-----
> From: R-help <[hidden email]> On Behalf Of Jenny Liu
> Sent: Saturday, December 22, 2018 7:10 AM
> To: Michael Dewey <[hidden email]>
> Cc: [hidden email]
> Subject: Re: [R] Glitch in Kruskal-Wallis test?
>
> Hi Michael,
>
> Thank you for your reply! I'm testing the difference in proportions. Temp
> is temperature, and Prop is the proportion of insect pupae that survived at
> that temperature. I was told by a statistician that the K-W was appropriate
> for testing proportions, but perhaps you know of an alternative? I have
> already tested for heteroscedasticity using the Breusch-Pagan test.
>
> Thanks again,
> Jenny
>
>
>
> On Dec 22, 2018 7:38 AM, "Michael Dewey" <[hidden email]> wrote:
>
> Dear Jenny
>
> What exactly do you think you are testing here? You are telling K-W you
> have seven groups each with a single value which is not the usual
> situation for K-W.
>
> Michael
>
>
> On 22/12/2018 04:58, Jenny Liu wrote:
> > Hi everyone,
> > I have been running a K-W test with the attached data, PupMort1. My code:
> > kruskal.test(Prop~Temp,data=PupMort1)
> > However, I found that I get the exact same result when I change the
> x-values, as
> > in the attached data PupMort2.
> > Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp
>
> > Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> > Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp
>
> > Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
> > Does anybody know why this is happening?
> > Thank you!
> > Jenny
> >
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Glitch in Kruskal-Wallis test?

JLfish
Thank you very much Michael and Bert! I'll have to look for some other
statistical test. Have a great holiday!

On Sat, Dec 22, 2018, 10:36 AM Bert Gunter <[hidden email] wrote:

> ... Moreover, you should not analyze proportions in this way, which treats
> .5 = 2/4 or .5 = 2000/4000 identically. As David said, you need to work
> with a statistician.
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Sat, Dec 22, 2018 at 7:32 AM David L Carlson <[hidden email]> wrote:
>
>> You may need to spend some more time with the statistician who needs to
>> see your data. It is not clear if you have a two sample test or a paired
>> sample test. Kruskall-Wallis expects data for each observation, not grouped
>> data. Without the observations, the test cannot compute the sample size and
>> the degrees of freedom. You have run kruskal.test separately on each
>> sample. The kruskal.test is designed for comparing two or more samples.
>>
>> ----------------------------------------
>> David L Carlson
>> Department of Anthropology
>> Texas A&M University
>> College Station, TX 77843-4352
>>
>> -----Original Message-----
>> From: R-help <[hidden email]> On Behalf Of Jenny Liu
>> Sent: Saturday, December 22, 2018 7:10 AM
>> To: Michael Dewey <[hidden email]>
>> Cc: [hidden email]
>> Subject: Re: [R] Glitch in Kruskal-Wallis test?
>>
>> Hi Michael,
>>
>> Thank you for your reply! I'm testing the difference in proportions. Temp
>> is temperature, and Prop is the proportion of insect pupae that survived
>> at
>> that temperature. I was told by a statistician that the K-W was
>> appropriate
>> for testing proportions, but perhaps you know of an alternative? I have
>> already tested for heteroscedasticity using the Breusch-Pagan test.
>>
>> Thanks again,
>> Jenny
>>
>>
>>
>> On Dec 22, 2018 7:38 AM, "Michael Dewey" <[hidden email]> wrote:
>>
>> Dear Jenny
>>
>> What exactly do you think you are testing here? You are telling K-W you
>> have seven groups each with a single value which is not the usual
>> situation for K-W.
>>
>> Michael
>>
>>
>> On 22/12/2018 04:58, Jenny Liu wrote:
>> > Hi everyone,
>> > I have been running a K-W test with the attached data, PupMort1. My
>> code:
>> > kruskal.test(Prop~Temp,data=PupMort1)
>> > However, I found that I get the exact same result when I change the
>> x-values, as
>> > in the attached data PupMort2.
>> > Test run with PupMort1Kruskal-Wallis rank sum testdata:  Prop by Temp
>>
>> > Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
>> > Test run with PupMort2Kruskal-Wallis rank sum testdata:  Prop by Temp
>>
>> > Kruskal-Wallis chi-squared = 6, df = 6, p-value = 0.4232
>> > Does anybody know why this is happening?
>> > Thank you!
>> > Jenny
>> >
>> >
>> > ______________________________________________
>> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> > and provide commented, minimal, self-contained, reproducible code.
>> >
>>
>> --
>> Michael
>> http://www.dewey.myzen.co.uk/home.html
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>> ______________________________________________
>> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.