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?
Silverman's rule-of-thumbHey, I have a question regarding the bandwidth calculated by Silverman's rule of thumb. I am using …
Need reference or material on ordering.Hello, I have two questions. 1. What ordering options are available other than Cholesky Decompositio…
Assign the oldest in a household as headUsing index as household identifier, a3age as Age,1== head in the relationship …
Endogeneity test (for ordered probit model) after CMP command?I am using ordered probit model with (dummy) endogenous variable. I am interested to test the endoge…
locals and varnamesDear all, say that i want to create new variables using a numlist as follows: Code: forvalues i=5(…
Subscribe to:
Post Comments (Atom)
0 Response to How to generate a variable which takes for every combination another value?
Post a Comment