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?
Adding region fixed effects in ordered-probit estimation in a cross-section analysisMy dependent variable can take 3 distinct values so I am leaning towards using ordered-probit estima…
Interpreting retransformation of dependent variable in regression analysisHi statalisters, I have question about interpreting the retransformed coefficient in a regression a…
Using local macro to create 'blocks' of variables to be used in multivariable regression analysesDear Statalisters, There have been several parallel threads on using local macros to create lists of…
inlist alternatives?inlist seems to have a very small limit for the number of arguments /size of list it can take. i'd l…
3SLS and Limited Dependent VariableHello, I'm trying to estimate a 3-equation model in which my first stage dependent variable is a co…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a variable which takes for every combination another value?
Post a Comment