Chi square and its applications