I am working with a longitudinal panel dataset collected from an online auction. For each observation, there is a time stamp that includes a date together with hour and minute, but no second. This results in a problem as there could be multiple observations in a given minute for the same id. The solution I seek your help implementing implies adding a single consecutive second to each of the duplicate time stamps. For example:
16mar2021 14:40:00 --> 16mar2021 14:40:01
16mar2021 14:40:00 --> 16mar2021 14:40:02
16mar2021 14:40:00 --> 16mar2021 14:40:03
The example of the data for experimentation is provided below. Your feedback is greatly appreciated.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float id double datetime 11291 1.9309035e+12 11291 1930903680000 11291 1930903920000 11291 1930904280000 11291 1.9309059e+12 11291 1.9309068e+12 11291 1930907580000 11291 1930907880000 11291 1930907940000 11291 1.930908e+12 11291 1930908060000 11291 1930908180000 11291 1930915320000 11291 1930921260000 11291 1930989960000 11291 1931013240000 11291 1.9311711e+12 11291 1931271240000 11291 1.9313307e+12 11291 1.9313805e+12 11291 1.9313856e+12 11291 1931424480000 11291 1.9314276e+12 11291 1931432940000 11291 1931512740000 11291 1931512860000 11291 1.9315182e+12 11291 1931521260000 11291 1931521680000 11291 1931521980000 11291 1.9315221e+12 11291 1931522220000 11291 1931522580000 11291 1931522760000 11291 1931522880000 11291 1.9315233e+12 11291 1931524440000 11291 1931524440000 11291 1931524620000 11291 1931524620000 11291 1931524680000 11291 1931524680000 11291 1931524680000 11291 1931524680000 11291 1931524740000 11291 1931524740000 11291 1.9315248e+12 11291 1.9315248e+12 11291 1.9315248e+12 11291 1.9315248e+12 11291 1.9315248e+12 11291 1931524860000 11291 1931524860000 11291 1931524860000 11291 1931524860000 11291 1931524920000 11291 1931524980000 11291 1931525040000 11291 1931527740000 11291 1931537220000 11291 1931975880000 end format %tc datetime
0 Response to Dealing with duplicate time stamps in auction data
Post a Comment