Estimating the correlation between two variables with a contingency table and a chi-squared test