Hello,
I appreciate if you could help me on formatting 1-minute data.
I have datetime variable as “2005-01-01T00:00:00.000000000Z”. As a first step I run the following commands
gen str date = substr(datetime, 1, 10)
gen hour = real(substr(datetime,12,2))
gen min = real(substr(datetime,15,2))
gen year= real(substr(datetime,1,4))
gen month= real(substr(datetime,6,2))
gen day= real(substr(datetime,9,2))
gen mdy=mdy(month,day,year)
format mdy %td
gen mytime=Cmdyhms(month,day,year,hour,min,0)
format mytime %tc
However, when I tsset my dataset by “mytime”, I got the error as “repeated time values in sample”. I couldn’t figure out the accurate format for seconds I guess.
Pinar
Related Posts with Intraday Data (1 Minute data)
Interaction Using Single Hashtag (#)Dear Experts, My objective is to get two coefficients with corresponding p-values before and after …
How to Append Logistic Regression Outputs Using ASDOCHi, Stata Users: Can someone please demonstrate how to append logistic regression outputs using the…
volatility of the firm's equity(annualized standard deviation)Dear All, Hope my msg finds you very well. I have a panel data 252 observations (daily ) (id, date…
Distance between two coordinatesGoodmorning, I want to calculate the distance between two x,y coordinates. However, I have a list of…
Creating time trendsHi, I have a question regarding creating time trends to account for time effects before and after t…
Subscribe to:
Post Comments (Atom)
0 Response to Intraday Data (1 Minute data)
Post a Comment