Dear all,

I have a dataset that contains a precise time when an observation was made ( formated as %tc_DD-NN-YY_HH:MM: SS.sss). My intention is to create another variable, that contains the previous observation's observation time. However, I am not familiar with lag variables. I tried reading through the tsset help, but no luck. Whenever I actually try to create the lag variable, I only get missing values.

Any tip on how I could create this variable?