Hi Rick,

Thank you for sharing. I encountered some issue when using your method. Unfortunately, I cannot share the data with you. The problem I encountered is that your method will ignore some dummies for an unknown reason. For example, there are two countries in my data, A and B. Out of 2000 observations, only 200 are from country B. In this case, the method choose to create only Country_A. However, not all variables are like that. I currently do not have a clue about what is the reason behind it. My feeling is that having missing values, too many categories, and very unbalanced distribution are plausible causes to the problem but none of them can explain the problem by itself. Have you met similar problems? I will dig deeper to see why it does that, your opinion will definitely be valuable! Thanks.

Sincerely,
David