Hi! I have a dataset with minute data (stock price) which I would like to convert into 30min data intervals. Im not very familiar with Stata but I try to learn it with my thesis. The data is reported in unix time. I have done the following commands:
rename timestamp unixtime
generate double statatime = unixtime * 1000 + mdyhms(1,1,1970,0,0,0)
generate double statatime2 = unixtime * 1000*30 + mdyhms(1,1,1970,0,0,0)
collapse close,by(statatime2)
Variable close = close price
Statatime2 gives me intervals of 30 minutes but the dates are clearly wrong. How do I get my 30 min intervals to respond to the right unixtime? Or is it another more effiecient way to convert my 1 minutes data into 15 min intervals? A step-by-step instruction would be highly preciated!
Thanks for any help!
Related Posts with Convert high frequency data to lower frequency
Using Ghostscript to Increase Resolution of GraphHello all, I am seeking to increase the resolution of a graph to 300 dpi for publication. While I'v…
Test two models for best fitHi Stata I want to test two models against each other to see if one's fit is significantly better t…
Confusion about the command "suest"Hi Statalist, I think I want to use the command "suest" to test if two coefficient estimates are th…
Checking for Missing Head of Houshold within a householdHello, I have a data set on household survey where the household size, member of the household numbe…
Trigonometric RegressionDear All, I want to do Trigonometric Regression to find the coefficient of cyclic variation to meas…
Subscribe to:
Post Comments (Atom)
0 Response to Convert high frequency data to lower frequency
Post a Comment