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
"No observations" problemHello, I have a problem when generating new variables out of existing one. I have a variable "pclas…
Putexcel with row and column name labelsI am trying to export tables from stata to word using putexcel, where the row and column variables h…
Assigning Values of Variable for All PanelsHi all, I have tried finding a post already discussing this issue but have not found any; apologies…
Cross section Panel data for exam - elections across 23 countriesHi all. I appear to be in deep, so hoping anyone can help. Im doing an exam in quantative methods. …
analyzes of companies accountsI am trying to make an analysis of all danish companies accounting for some years. Do any one have m…
Subscribe to:
Post Comments (Atom)
0 Response to Convert high frequency data to lower frequency
Post a Comment