In the example below, the time-series lag operator behaves as I would expect for gen id2, but not for replace id. Why isn't id equal to id2 here? I am using the latest version of StataSE 17.
Output:
Code:
clear input id t 1 1 1 2 1 3 2 1 2 2 2 3 end tsset id t gen id2 = L.id replace id = L.id
id | t | id2 |
. | 1 | . |
. | 2 | 1 |
. | 3 | 1 |
. | 4 | . |
. | 5 | 2 |
. | 6 | 2 |
Comment