Categorical variables take on values that are names or labels.
Example: The color of a ball (e.g., red, green, blue) or the breed of a dog (e.g., collie, shepherd, terrier) would be examples of categorical variables.
The values of a categorical variable are selected from a small group of categories.
Examples are gender (male or female) and marital status (never married, married, divorced or widowed).
A categorical or discrete variable is one that has two or more categories or values.
There are two types of categorical variable, nominal and ordinal.
Thus, gender is a categorical data and not a random variable that can take values, male and female.
This categorical data can be converted into discrete random variable by assigning an identity that is 0 for male and 1 for female.