Chi square goodness of fit formula