I am trying to create a new variable that is the sequence of observations of 3 variables
In this data, I want to generate a new variable seq which would take the value from the 3 variables as
At the end, I would like to know the number of observations in each pattern
Can anyone please help?
Code:
clear input id var1 var2 var3 1 1 2 3 2 2 2 2 3 3 3 3 4 3 3 3 5 3 1 1 6 2 2 2 end
Code:
input seq 123 222 333 333 311 222 end
Code:
tab seq
Comment