can you define a median for an unordered categorical variable
As a result, the central tendency of a set of categorical variables is given by its mode; neither the mean nor the median can be defined. As an example, given a set of people, we can consider the set of categorical variables corresponding to their last names. We can consider operations such as equivalence (whether two people have the same last name), set membership (whether a person has a name in a given list), counting (how many people have a given last name), or finding the mode (which name occurs most often). However, we cannot meaningfully compute the ``sum'' of Smith + Johnson, or ask whether Smith is ``less than'' or ``greater than'' Johnson. As a result, we cannot meaningfully ask what the ``average name'' (the mean) or the ``middle-most name'' (the median) is in a set of names.
Categorical variable