1
$\begingroup$

I've ran the Chi-Squared test for the following crosstable and got some weird results. Is there anyone who can help me work out the problem?

            Category
  AGE_Category Very Low  Low Medium High Very High
       (0,1]     9763 24097   7113 11431      2389
       (1,2]    14053 17048  12438 10869      1930
       (2,3]     2797 10106  12768  6751      1551
       (3,4]        3  3771   4810  2494      1253

> chisq.test(AGE_Category,Category, simulate.p.value = TRUE,correct=FALSE)

    Pearson's Chi-squared test with simulated p-value (based on 2000
    replicates)

data:  AGE_Category and Category
X-squared = 15520, df = NA, p-value = 0.0004998

> chisq.post.hoc(table(AGE_Category,Category), test="chisq.test")
Adjusted p-values used the fdr method.

       comparison raw.p adj.p

1 (0,1] vs. (1,2]     0     0
2 (0,1] vs. (2,3]     0     0
3 (0,1] vs. (3,4]     0     0
4 (1,2] vs. (2,3]     0     0
5 (1,2] vs. (3,4]     0     0
6 (2,3] vs. (3,4]     0     0
$\endgroup$
  • $\begingroup$ Why is one test AgeCategory3 and the other AgeCategory? $\endgroup$ – mdewey Jan 18 '17 at 9:54
  • $\begingroup$ I changed the long name of the variables before I posed it here (to make the code shorter), and it should not be the reason of the Zero Results.. $\endgroup$ – jin mu Jan 18 '17 at 10:51
  • $\begingroup$ What is the data type of your data set? Calling table() may not produce the results you expect-- have you verified that the result of that call is what you intend? $\endgroup$ – Upper_Case Jan 18 '17 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.