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)
Value labels: re-coding, assigning multiple labels to one value and differentiation in variablesHi all, I want to recode two of my value labels, which are used for multiple variables. The first …
Multilevel model error with covariance (unstructured) - Hessian is not negative semidefinite conformability errorI'm testing a multilevel model with random slopes and a covariance structure for the error and reml …
Merging datasetsI have two datasets that I want to merg- One from the screening registry and the other one from a ho…
from stata to latex descriptive stat and ttestHi everyone! I'm working on same descriptive statistics and ttest tables on Stata and I want to exp…
Using mrobust with polynomial independent variableDear community, I'd like to use the "mrobust" command by Young & Holsteen (2017) for estimating…
Subscribe to:
Post Comments (Atom)
0 Response to Intraday Data (1 Minute data)
Post a Comment