Formula of chi square test