Exploring Chi-square and correlation in R