だいぶ前に見つけて,忘れてしまっていたのを再発見したので記録。
> x <- data.frame(a=sample(3, 100, rep=T), b=sample(2, 100, rep=T), c=sample(3, 100, rep=T))
> summary(xtabs(~., data=x))
Call: xtabs(formula = ~., data = x)
Number of cases in table: 100
Number of factors: 3
Test for independence of all factors:
Chisq = 11.541, df = 12, p-value = 0.4832
Chi-squared approximation may be incorrect