Hello!

I am working with online auction data (see -dataex- below), where id is the listing identifier, id_user is the auction participant identifier, datetime is time stamp, bid = 1 if observation is a bid vs. comment (=0), and bid_it is a bid (in $). The auction runs for 7 days and at any time any user can either make a bid or leave a comment. That is why there are missing values between the bids

For each of the bids, what would be the appropriate way to calculate the difference between the current and previous bids (vs. absolute monetary values)?

Thanks!

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input int id float id_user double datetime float bid long bid_it
2 12613 1952878380000 1 66500
2     . 1952878440000 1     .
2 12613 1952878440000 1 67500
2  9609 1.9528785e+12 1 68000
2 24717 1952878620000 0     .
2 12613 1952878620000 1 69500
2  3352 1952878620000 1 69000
2 11882 1952878680000 0     .
2  5980 1952878740000 0     .
2 18853 1952878740000 0     .
2  3364 1952878740000 1 70000
2 12613 1.9528788e+12 1 70500
2 12613 1952878860000 0     .
2  9099 1952878860000 0     .
2  3352 1952878920000 1 71000
2  3364 1952878980000 1 71500
2 15927 1952879040000 1 72211
2  3352 1.9528791e+12 1 75211
2  9609 1952879160000 0     .
2 11882 1952879220000 0     .
2 12613 1952879220000 1 76211
2 11882 1952879280000 0     .
2 18853 1952879280000 0     .
2 12613 1952879280000 1 78211
2  3364 1952879280000 1 77211
2  9609 1952879340000 0     .
2  5980 1952879340000 0     .
2  3364 1.9528794e+12 1 79211
2 12613 1952879460000 1 79711
2 21154 1952879580000 1 80711
2  3352 1952879580000 1 80211
2 12565 1.9528797e+12 0     .
2     . 1.9528797e+12 1     .
2 11267 1952879760000 0     .
2 24717 1952879760000 0     .
2  3352 1952879760000 0     .
2  9099 1952879820000 0     .
2 11267 1952879880000 0     .
2 11267 1952880120000 0     .
2 12613 1952881080000 0     .
3 17377 1952283540000 0     .
3   914 1952283540000 0     .
3 11176 1952283780000 0     .
3 24784 1952284440000 0     .
3   345 1952284980000 0     .
3 15933 1952285160000 0     .
3  4324  1.952286e+12 0     .
3  4324  1.952286e+12 1 20000
3  4541 1952286120000 0     .
3 13497 1952291040000 0     .
3  4541 1952292420000 0     .
3 14562 1952311380000 1 20250
3 14562 1952311440000 0     .
3 23221 1952318940000 0     .
3  6403 1952322420000 0     .
3 17926 1952323680000 0     .
3 17896 1952326620000 0     .
3  4262 1952327640000 0     .
3  4541 1952328660000 0     .
3  1536 1952328780000 0     .
3   139 1952329740000 0     .
3 24707 1952329920000 0     .
3  4541 1952329980000 0     .
3 23436 1952330280000 0     .
3  9997 1952330280000 0     .
3   914 1.9523304e+12 0     .
3  9086 1952331180000 0     .
3 23436 1952331360000 0     .
3 23424 1952331960000 0     .
3 23436 1952332140000 0     .
3 26316 1952336640000 0     .
3 16396 1.9523373e+12 0     .
3  4541 1952339340000 0     .
3 23701 1952343180000 1 21000
3  8933 1.9523445e+12 0     .
3  3613 1952353020000 0     .
3  4285 1952353920000 0     .
3  2638 1952354340000 0     .
3  5746 1952358060000 0     .
3  4541 1952358780000 0     .
3 23436 1952363220000 0     .
3  7012 1952368920000 0     .
3 22082 1952372040000 0     .
3 21217 1952374320000 0     .
3  1536 1952377020000 0     .
3  1622 1952380020000 0     .
3 11950 1952412060000 0     .
3 23436 1.9524147e+12 0     .
3  4541 1952422920000 0     .
3 17165 1952433180000 0     .
3 14629 1952442540000 1 22000
3  4123 1952446440000 1 23426
3 15638 1952446740000 0     .
3  7329 1952502420000 0     .
3  9907 1952513280000 0     .
3  9907 1952513340000 1 24426
3  6603 1952534520000 0     .
3  4541 1952544060000 0     .
3   853 1952548080000 1 25555
3 23518   1.95255e+12 0     .
end
format %tcNN/DD/CCYY_HH:MM datetime