Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Datetime as tsset


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Datetime as tsset
Date   Wed, 25 Nov 2009 20:24:36 +0100

<>

*******
clear*

input byte (day interval price)
1 1 43
1 2 42
1 3 39
1 4 48
2 1 12
2 2 23 
2 3 22 
2 4 21
end

gen logprice=log(price)

compress

tsset day interval
gen return=logprice-L.logprice

list, noo sepby(day)
*******


HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Katia Bobulova
Sent: Mittwoch, 25. November 2009 19:03
To: statalist@hsphsun2.harvard.edu
Subject: st: Datetime as tsset

Dear All,

I am tying to calculate the return( the absolute difference between
two log prices) for my series of data.
I need to calculate it for each day and each time intervals, so this
means that I don't want the difference between the last price of one
day and the first price of the next day. My time goes from 8:30 to
17:30.
I construct the variable datetime that combines the date and the time.
I used it as tsset  but it doesn't work.

Do you have any suggestion?

Thanks a lot

Katia
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index