Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205399

How can I transform a data frame to run chisquared test on it?

$
0
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

Let's say I have a data frame that looks like this. It is basically a word frequency table. How can I convert it into a table so that I can run the chi squared test of independence on it?

chisq.test(data.table)

Viewing all articles
Browse latest Browse all 205399

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>