Skip to content

Instantly share code, notes, and snippets.

@barik
Created May 21, 2012 00:34
Show Gist options
  • Save barik/2760048 to your computer and use it in GitHub Desktop.
Save barik/2760048 to your computer and use it in GitHub Desktop.
> d5.rat
0 1 2 3 4 5
d5.rat 31 203 244 297 184 25
0 328 164 164 328 0
> chisq.test(d5.rat)
Pearson's Chi-squared test
data: d5.rat
X-squared = 179.9828, df = 5, p-value < 2.2e-16
> d5.rat[,c(2:5)]
1 2 3 4
d5.rat 203 244 297 184
328 164 164 328
> chisq.test(d5.rat[,c(2:5)])
Pearson's Chi-squared test
data: d5.rat[, c(2:5)]
X-squared = 122.4477, df = 3, p-value < 2.2e-16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment