The chi-square test is used to determine if differences in frequencies observed in qualitative variable categories are statistically significant or likely due to chance. An example compares influenza rates in a vaccine vs placebo group in a clinical trial. The expected and observed frequencies are calculated. The chi-square test statistic is greater than the critical value, so the null hypothesis that the vaccine and placebo have the same influenza proportion is rejected. Therefore, the difference is likely due to the vaccine's effectiveness rather than chance.