The chi-squared statistic is a non-parametric test that compares the observed frequencies of events to the expected frequencies under the null hypothesis. It is used primarily for categorical dataâdata that can be divided into different categories that are mutually exclusive. For example, it can be used to determine if there is an association between smoking status (smoker vs. non-smoker) and the incidence of lung cancer (yes vs. no).