calc_chi2 function

Vectorized computation of chi^2 statistic for a 2x2 crosstab containing the values [a, b] [c, d]