Dear Statausers,
I am using Stata 14.1. I have intraday data at 15 minutes interval. It look likes the following:
2014-01-01 00:00:00+01:00
2014-01-01 00:15:00+01:00
2014-01-01 00:30:00+01:00
2014-01-01 00:45:00+01:00
....
From this previous Statalist post:
http://www.stata.com/statalist/archi.../msg00042.html
I did the following:
as well as this alternative code:
Sadly, I am getting missing values using both approaches. Any help in solving this issue is highly appreciated. Thank you.
Regards,
Syed Basher
I am using Stata 14.1. I have intraday data at 15 minutes interval. It look likes the following:
2014-01-01 00:00:00+01:00
2014-01-01 00:15:00+01:00
2014-01-01 00:30:00+01:00
2014-01-01 00:45:00+01:00
....
From this previous Statalist post:
http://www.stata.com/statalist/archi.../msg00042.html
I did the following:
Code:
gen str date = substr(time, 1, 10) assert substr(time,11,1)==" " gen hour = real(substr(time,12,2)) assert substr(time,14,1)==":" gen min = real(substr(time,15,2)) assert substr(time,17,1)==":" gen sec = real(substr(time,18,2)) gen edate = date(date, "ymd") gen double secs = edate*24*60*60 + hour*60*60 + min*60 + sec
Code:
split time, p(" " :) destring gen edate = date(time1, "ymd") gen double secs = edate*24*60*60 + time2*60*60 + time3*60 + time5
Regards,
Syed Basher
Comment