Analyzing categorical data using a chi-square test