A chi-square test of independence can be used to determine if there is a relationship between two categorical variables. It is a nonparametric hypothesis test for nominal and ordinal variables. Nominal variables are simply named or labeled without order, like eye color or gender. Ordinal variables have a specific order between their options, such as education level or customer satisfaction ratings. A chi-square test can test if two such variables, like education level and customer purchases, are independent of each other.