0
    word    freq.x  freq.y
1             1       1
2   1D        1       NA
3   5         2       NA
4   a         5       18
5   a0        8       4
6   about     1       NA
7   all       2       2
8   already   1       NA
9   always    2       2
10  and       4       12
11  another   1       NA

假设我有一个看起来像这样的数据框。它基本上是一个词频表。如何将其转换为表格,以便对其进行独立性卡方检验?

chisq.test(data.table)
4

1 回答 1

1

chisq.test(data.table$freq.x, data.table$freq.y)或者chisq.test(as.matrix(data.table[c('freq.x', 'freq.y')]))

于 2012-11-25T14:27:45.607 回答