I had some problems describing the problem nicely, however I think this explanation will make it clear:
My data looks like this:
Code:
clear input str7 subject double(observation_start_date time_start time_end flowrate_per_hour amount) "tom" 21913 1.8934416e+12 1.8935784e+12 3 114 "tom" 21913 1.8936108e+12 1.8936216e+12 5 15 "carlos" 21917 1.893834e+12 1.8940248e+12 2 106 "natasha" 21926 1.894446e+12 1.8946224e+12 7 343 end format %td observation_start_date format %tc time_start format %tc time_end
This would like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str7 var1 byte day1 int day2 byte(day3 day4 day5 day6) "tom" 0 12 72 45 0 0 "carlos" 0 0 30 48 28 0 "natasha" 91 168 84 0 0 0 end
Yours sincerely
Fab
0 Response to Converting datetimeranges to multiple calender date variables
Post a Comment