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
Related Posts with How to generate a variable which takes for every combination another value?
Graph export multiple using loopsI have been trying to create and export multiple graphs using the following code, instead I am getti…
Survey Weights in the Construction of Adult Literacy RatesHi, I have household survey data from a country with the following variables: district ID (distid)…
suest alternative for panel dataHi, I have a panel GDP data for over 200 countries for the years 1990 to 2018, which I am reducing …
Changing the line colour of panel data line plot according to an indicator variableDear forum, I have a set of longitudinal patient data representing patient id (subjid), time in stud…
Appending models using coefplotI would like to merge multiple models into the same series (crude/adjusted/further adjusted models) …
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a variable which takes for every combination another value?
Post a Comment