I find it is still necessary to clarify the logic behind the wanted id. Consider the below example:
Note the added observation in red, which starts at 9 that appears to be the end of 2 different obs (obs 2 and obs 9).
For that specific sample, code 1 and code 2 give different outputs. I show below the output for code 2, which seems ... undesirable.
Code:
clear
input byte(var1 var2)
2 7
7 9
7 11
11 12
6 8
8 9
10 15
15 19
50 51
9 14
end
For that specific sample, code 1 and code 2 give different outputs. I show below the output for code 2, which seems ... undesirable.
Code:
+------------------+ | var1 var2 id | |------------------| 1. | 2 7 1 | 2. | 7 9 1 | 3. | 7 11 1 | 4. | 11 12 1 | 5. | 6 8 1 | 6. | 8 9 1 | |------------------| 7. | 10 15 2 | 8. | 15 19 2 | |------------------| 9. | 50 51 3 | |------------------| 10. | 9 14 4 | +------------------+
Comment