# Can we treat gender as ordinal variable?

I know this question is stupid, but it is really make me confused. If we have the gender variable, and then encode it as 0 (female) and 1 (male). Most people would say we should treat gender as nominal data, since male and female are not quantitative values.

However, what if we consider the number of Y chromosome? In general, male has one Y chromosome, and female has zero Y chromosome. The number of Y chromosome is the ordinal variable. Then, we can get the data like this,

observation   gender      #Y chromosome
1           male (1)        1
2           female(0)       0
3           female (0)      0
4           male (1)        1


In that case, is it okay that we treat gender (0,1) as ordinal variable?

• What difference would it make? It is still a dichotomous variable.
– Kuku
Commented Nov 2, 2020 at 11:46
• There is a question you don't ask of whether gender is a binary variable. But given that your data arrive as binary, what is then important is that binary variables are special in at least two senses. I'd say that (e.g.) rank correlations show that binary variables are ordinal in an extended sense: that is, the rank correlation between gender and some other variable is well defined apart from a convention about sign of correlation. Binary variables are only one step away from measurement insofar as taking the mean of a binary variable coded as 0 and 1 gets you a probability. Commented Nov 2, 2020 at 11:46
• But why you want to know is a fair comment in return. Binary variables are fine in regression-type models as responses or as predictors. The only other reason I can think for exploring this is a desire for some nonparametric test. Commented Nov 2, 2020 at 11:48
• You could also treat it as interval if you really want to use that system since there is only one interval and so every interval is equal to every other interval. But really you would be better to focus on what the variable actually is as @Kuku points out. Commented Nov 2, 2020 at 11:48
• The argument that gender is really counting chromosomes is tendentious, not least because you then get into a tangle over not having data on everyone's chromosomes, which can be more variable than XX or XY. . Commented Nov 2, 2020 at 11:49

## 1 Answer

Since you have only two categories (M and F) then both the ordinal and nominal classification lead to 0 and 1 encoding so there is no difference. Whether you assign 0 to male or to female is just a matter of making the interpretation of the output easier so your decision based on Y chromosome is acceptable, I think.

• But please note the problem that @NickCox raises in a comment: in reality, sex-chromosomal complements can go beyond just XX or XY. Your main point, that there is no difference between ordinal and nominal when there are only 2 categories, is of course correct.
– EdM
Commented Nov 2, 2020 at 15:52
• @EdM it seems to me that the OP is bringing in the number of Ys only to justify sex as an ordinal variable. Such justification is not required since sex is binary but it can still make the encoding more intuitive. Commented Nov 2, 2020 at 21:12