I have some items described by 43 categories like this:
Dataset Item Category1 Category2... Category43
D1 Item1 1 0 0 ... 1 ...
D1 Item3 1 0 0 ... 1 ...
D2 Item4 1 0 0 ... 1 ...
..
What I did was to create a frequency table like this
Dataset Category1 Category2... Category43
D1 617 388 ... 827
D2 1234 7272 ... 1237
I am testing to see if there is a relationship between the dataset type and the category frequency counts.
I have the following data as the output of dput
:
structure(list(data.OldFrequency = c(617L, 388L, 6L, 9L, 1344L,
857L, 30L, 63L, 60L, 22L, 23L, 107L, 9L, 16L, 9L, 10L, 14L, 28L,
9L, 174L, 245L, 103L, 4096L, 121L, 6L, 48L, 189L, 33L, 1426L,
64L, 16L, 135L, 77L, 26L, 110L, 44L, 75L, 1610L, 1022L, 38L,
1578L, 242L, 67L), data.NewFrequency = c(1220L, 959L, 307L, 29L,
5093L, 771L, 65L, 125L, 120L, 41L, 187L, 203L, 11L, 87L, 20L,
159L, 45L, 68L, 60L, 11L, 644L, 51L, 7053L, 159L, 6L, 162L, 208L,
52L, 3277L, 27L, 594L, 79L, 95L, 119L, 96L, 84L, 180L, 2991L,
2227L, 34L, 2249L, 37L, 29L)), .Names = c("data.OldFrequency",
"data.NewFrequency"), row.names = c(NA, -43L), class = "data.frame")
Running chisq.test
using this gives me the following:
Pearson's Chi-squared test
data: d
X-squared = 2551.405, df = 42, p-value < 2.2e-16
Warning message:
In chisq.test(d) : Chi-squared approximation may be incorrect
I am confused on what null hypothesis this is testing and what the implications of this are. Can someone please help me understand how to interpret this? I am not a statistician and would love if someone could explain this in simple words. And how would I fix the warning message?
dput
object (43 rows x 2 columns, hence 42 df), which doesn't resemble any of the raw or counts data supplied above. This certainly does not test whether "there is a relationship between the dataset type and the category frequency counts". A correct $\chi^2$ would have (# items - 1) x (# categories - 1) df, provided it makes sense to use such a test. We need additional information to help you more. $\endgroup$