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?
Monthly variation in incidence: exposure in Poisson regressionI am trying to estimate the variation of a disease incidence by month. The disease incidence should …
Difference-in-differences: regress or teffects?Dear Statalist users, I have been working on trying to find whether there has been a positive impact…
Random and Fixed Effects with normally distributed error termsHey there, I found my error terms to be normally distributed after running an OLS regression. (You c…
Error 902 when using geocodeI've been using geocode to calculate the travel distance and travel time between 745 pairs of addres…
A problem with iteration log likelihood not concave in xtpmg commandHi everyone, When I run the PMG model by xtpmg command, I have a problem the iteration log likelihoo…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a variable which takes for every combination another value?
Post a Comment