Listing | timestamp_first | timestamp_last | M1 | M2 | M3 | M4 | M5 |
0001 | 1 | 5 | 1 | 1 | 1 | 1 | 1 |
0002 | 2 | 5 | 0 | 1 | 1 | 1 | 1 |
0003 | 3 | 5 | 0 | 0 | 1 | 1 | 1 |
gen M1 = (timestamp_first<2)
gen M2 = (timestamp_first<3)
gen M3 = (timestamp_first<4)
etc.....
However this code does not work when for some listing (e.g. 0004) the last timestamp is not 5 as in the above example, but 3. See below table:
Listing | timestamp_first | timestamp_last | M1 | M2 | M3 | M4 | M5 |
0004 | 2 | 3 | 0 | 1 | 1 | 0 | 0 |
Thank you very much in advance.
0 Response to Coding 1/0 between timestamps
Post a Comment