Dear Statalist,
Not sure if I am missing something obvious in -egen-, but I couldn't figure out an easy way to do the following task:
I would like to have as a result this:
cat_A cat_B cat_C
S1 C1 1
S1 C2 2
S2 C6 1
S2 C8 2
S3 C10 1
S3 C22 2
S3 C93 3
Thank you in advance for any tips.
All the best,
Tiago
Not sure if I am missing something obvious in -egen-, but I couldn't figure out an easy way to do the following task:
Code:
clear input str20 cat_A str20 cat_B S1 C1 S1 C2 S2 C6 S2 C8 S3 C10 S3 C22 S3 C93 end
cat_A cat_B cat_C
S1 C1 1
S1 C2 2
S2 C6 1
S2 C8 2
S3 C10 1
S3 C22 2
S3 C93 3
Thank you in advance for any tips.
All the best,
Tiago
Comment