Hi everyone,
I'm teaching statistics and started incorporating Excel alongside R. When we got to running a Chi-Square test, I noticed something very odd that I cannot figure out. Can someone tell me why I get different results with the same formula function.
Note, I'm using Excel 365 on Windows 10.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Observed[/TD]
[TD]past[/TD]
[TD]present[/TD]
[TD]future[/TD]
[TD]row.total[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]up[/TD]
[TD]12[/TD]
[TD]45[/TD]
[TD]78[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]down[/TD]
[TD]23[/TD]
[TD]56[/TD]
[TD]89[/TD]
[TD]168[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]col.total[/TD]
[TD]35[/TD]
[TD]101[/TD]
[TD]167[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Expected[/TD]
[TD]past[/TD]
[TD]present[/TD]
[TD]future[/TD]
[TD]row.total[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]up[/TD]
[TD]15.59[/TD]
[TD]45.00[/TD]
[TD]74.41[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]down[/TD]
[TD]19.41[/TD]
[TD]56.00[/TD]
[TD]92.59[/TD]
[TD]168[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]col.total[/TD]
[TD]35[/TD]
[TD]101[/TD]
[TD]167[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
When I use =CHISQ.TEST(B2:D3,B8:D9) I get a p-value of 0.4051 which is correct.
BUT.....
If I rearrange the tables to look like below, I get a different p-value.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]observed[/TD]
[TD]expected[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]up past[/TD]
[TD]12[/TD]
[TD]15.59[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]up present[/TD]
[TD]45[/TD]
[TD]45.00[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]up future[/TD]
[TD]78[/TD]
[TD]74.41[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]down past[/TD]
[TD]23[/TD]
[TD]19.41[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]down present[/TD]
[TD]56[/TD]
[TD]56.00[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]down future[/TD]
[TD]89[/TD]
[TD]92.59[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]total[/TD]
[TD]303[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
When I use =CHISQ.TEST(I2:I8,J2:J8) I get a p-value of 0.8741 which is not correct.
What's going on that I am missing? Does it have something to do with how the degrees of freedom are being counted?
I didn't see an function option to specify a Goodness of Fit or Test for Independence, which would change how df is counted.
Is there a function to produce the Chi-Square statistic?
At first I thought it was =CHISQ.TEST(), because =CHISQ.DIST.RT also gives me the p-value if I provide it the Chi-Square statistic and the degrees of freedom.
When I start to type =CHI all of the options that pop-up have something to do with the probability and not providing the statistic.
I don't see Chi-Square listed in the Data Analysis Tookpak.
Thanks for the assist!
Shawn
I'm teaching statistics and started incorporating Excel alongside R. When we got to running a Chi-Square test, I noticed something very odd that I cannot figure out. Can someone tell me why I get different results with the same formula function.
Note, I'm using Excel 365 on Windows 10.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Observed[/TD]
[TD]past[/TD]
[TD]present[/TD]
[TD]future[/TD]
[TD]row.total[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]up[/TD]
[TD]12[/TD]
[TD]45[/TD]
[TD]78[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]down[/TD]
[TD]23[/TD]
[TD]56[/TD]
[TD]89[/TD]
[TD]168[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]col.total[/TD]
[TD]35[/TD]
[TD]101[/TD]
[TD]167[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Expected[/TD]
[TD]past[/TD]
[TD]present[/TD]
[TD]future[/TD]
[TD]row.total[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]up[/TD]
[TD]15.59[/TD]
[TD]45.00[/TD]
[TD]74.41[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]down[/TD]
[TD]19.41[/TD]
[TD]56.00[/TD]
[TD]92.59[/TD]
[TD]168[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]col.total[/TD]
[TD]35[/TD]
[TD]101[/TD]
[TD]167[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
When I use =CHISQ.TEST(B2:D3,B8:D9) I get a p-value of 0.4051 which is correct.
BUT.....
If I rearrange the tables to look like below, I get a different p-value.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]observed[/TD]
[TD]expected[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]up past[/TD]
[TD]12[/TD]
[TD]15.59[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]up present[/TD]
[TD]45[/TD]
[TD]45.00[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]up future[/TD]
[TD]78[/TD]
[TD]74.41[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]down past[/TD]
[TD]23[/TD]
[TD]19.41[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]down present[/TD]
[TD]56[/TD]
[TD]56.00[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]down future[/TD]
[TD]89[/TD]
[TD]92.59[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]total[/TD]
[TD]303[/TD]
[TD]303[/TD]
[/TR]
</tbody>[/TABLE]
When I use =CHISQ.TEST(I2:I8,J2:J8) I get a p-value of 0.8741 which is not correct.
What's going on that I am missing? Does it have something to do with how the degrees of freedom are being counted?
I didn't see an function option to specify a Goodness of Fit or Test for Independence, which would change how df is counted.
Is there a function to produce the Chi-Square statistic?
At first I thought it was =CHISQ.TEST(), because =CHISQ.DIST.RT also gives me the p-value if I provide it the Chi-Square statistic and the degrees of freedom.
When I start to type =CHI all of the options that pop-up have something to do with the probability and not providing the statistic.
I don't see Chi-Square listed in the Data Analysis Tookpak.
Thanks for the assist!
Shawn