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?
Bioequivalence for Dichotomous outcomes, and also with nested data.Seeking guidance for conducting a bioequivalence (or non-inferiortty) test comparing two groups, but…
Moving average invalid syntaxHi all, I'm creating my own moving average code since I only want the top four of the previous seve…
Help in Reshaping the DataI have data into this format Code: * Example generated by -dataex-. To install: ssc install dataex …
Importing descriptive tables with outreg2Hello, I´m trying to export the results of this descriptive table to word using the command outreg2 …
spmap: Horizontal legend with specified legend text optionsDear all, I'm trying to make a map with a nicer legend. I would like for the legend to look somethin…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a variable which takes for every combination another value?
Post a Comment