Hello Everyone!
I have a question about generating a sequence in Stata with a condition. I have a variable ( var= 0,0,0,1,0,0,1,0,0,0) and want to generate a sequence with a break whenever var=1 and then restarts. The new variable will be like this (newvar = 1,2,3, . , 1, 2, ., 1, 2, 3). I would appreciate your help in this respect.
Moeen
0 Response to Sequencing with a condition
Post a Comment