Dear all
I have a question. I have a dataset with lots of different variables and want to generate a new variable which takes for every possible combination of variables an other combination. For example, if I my variables would be gender and "under_30_years" than I would like to have a variable which takes the value 1 if male and not under_30_years, 2 if female and not under_30_years, 3 if male and under_30_years and 4 if female and under_30_years. I've heard that a possible way is to do that with egen tag. But how have I exactly to do it?
Best regards and thank you very much