I am matching two samples using a propensity score (I am using the MatchIt package in R as described here: https://www.r-bloggers.com/2016/06/how-to-use-r-for-matching-samples-propensity-score/). One variable is gender. Traditionally, gender is classified either as male or female, hence, the variable is binary/logical. However, I want to be inclusive and ask for different genders than male or female. Most participants, except about 1%, still self-describe as male of female. So I am not sure, whether one should treat the variable gender as a discrete (factor) variable despite the fact that most participants self-describe as either male or female?

I am not familiar enough with the mathematics behind the propensity score to know, whether this actually makes a difference.


1 Answer 1


If you do this then yes, it should be treated as a categorical variable with more than two categories. Statistically, there is nothing unusual about this --- we use categorical variables all the time. However, the obvious problem is that you will only get a small amount of data in the other categories, so the variability for the inferences for those categories will be large.

In terms of whether or not to do this, that really depends on whether you think the non-standard gender categories are an important "omitted variable" or whether you think its inclusion would be "over-fitting". There is a well-developed literature for the effect of omitted variables and overfitting in various kinds of models; for discussions in the context of propensity score models, see e.g., Arpino and Mealli (2011), Li (2012), Shuster, Lowe and Platt (2016) and Lenis, Ackerman and Stuart (2018).

Realistically, it would take a lot of data to get decent inferences about an effect for categories that are so small. You are probably going to find that you get an over-fitting problem if you add a category like this for such a small group. Indeed, it would not be surprising if you end up with one or more categories of one person (or no people) which will mean that the coefficient for that category will completely swallow the residual (or be non-identifiable) and you will get over-fitting.

  • $\begingroup$ Thank you very much for this answer and the references. At the moment I am thinking I will use the binary categories "male" and "not male" for matching as I have no specific hypothesis regarding gender in general (or non-binary genders specifically). $\endgroup$
    – Tahwan
    Jun 23, 2021 at 13:24
  • $\begingroup$ Bear in mind that such a method implicitly treats females the same as "non-males" of the "non-binary" variety, so even then you would be making an assumption of sorts (and of course, this would yield different results than if you used "female" and "non-female" instead). $\endgroup$
    – Ben
    Dec 29, 2023 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.