Chi-squared test for association with R