If both variables are categorical. We analyze an association through a comparison of conditional probabilities and graphically represent the data using contingency tables (Two-way table).
We have to make the two - way table of the X and Y values.
What is categorical variables ?
A categorical variable (also known as a qualitative variable) in statistics is a variable that may take one of a restricted, and typically fixed, number of potential values, allocating each human or other unit of observation to a specific group or nominal category based on some qualitative feature.
Some variables can be said to be categorical, or they can be treated as such based on the length of their unique values.
For example, if a variable contains only unique values [-2,4,56], you may consider it categorical.
Every unique value in every category variable will result in the creation of a new column.