Dear experts,
I want to create a data set that has for variable i the numbers from 1 to 156 (counting basically), then for each variable i I want to create variable j that has 35 new observations (counting from 1 to 35) and last for each variable j I want 75 new observations (counting from 1 to 75).
Put differently: I want to create variable Xijt that counts from i (1 to 156), from j (1 to 35), from t (1 to 75), so that I have only unique X combinations of these variables. e.g. X111, X112, X113, ... , X121, X122, ... , X156 35 75
I tried with the following code, but it does not work... how can I achieve this?
Thanks in advance!
I want to create a data set that has for variable i the numbers from 1 to 156 (counting basically), then for each variable i I want to create variable j that has 35 new observations (counting from 1 to 35) and last for each variable j I want 75 new observations (counting from 1 to 75).
Put differently: I want to create variable Xijt that counts from i (1 to 156), from j (1 to 35), from t (1 to 75), so that I have only unique X combinations of these variables. e.g. X111, X112, X113, ... , X121, X122, ... , X156 35 75
I tried with the following code, but it does not work... how can I achieve this?
Code:
set obs 409500 egen i = seq(), f(1) t(156) b(2625) egen j = seq(), f(1) t(35) b(11700) egen t = seq(), f(1) t(75) b(5460)
Comment