Hey,
thanks Martin. This is what I was looking for.
Best,
Kaspar
2009/10/21 Martin Weiss <[email protected]>:
>
> <>
>
>
>
> *************
> h xtset
> *************
>
>
>
> HTH
> Martin
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:[email protected]] Im Auftrag von Kaspar Dardas
> Gesendet: Mittwoch, 21. Oktober 2009 14:08
> An: [email protected]
> Betreff: st: tsset for GARCH estimation with repeating dates
>
> Hi Statalisters,
>
> I have a data set with 4 variables (date ret market_ret id) which
> looks as follows:
>
>
> date ret market_ret id
> 01/02/2009 1% 2% 1
> 02/02/2009 1.20% 2% 1
> 03/02/2009 -1% -4% 1
> 04/02/2009 -5% - 3% 1
> 01/02/2009 8% 2% 2
> 02/02/2009 9.00% 2% 2
> 03/02/2009 -16% -4% 2
> 04/02/2009 0.3% -3% 2
>
>
> Please note that date repeats/overlaps - (not for all ids but for some).
> I try to use a GARCH process to estimate abnormal returns for each id
> with the following loop:
>
> forvalues i=1(1) 1137 {
> l id gvkey if id==`i' & dif==0
> arch ret market_ret, arch(1) garch(1) if id==`i' & estimation_window==1
> predict p if id==`i'
> replace predicted_return = p if id==`i'
> drop p
> }
>
>
> My loop breaks because there is no time variable set. Whenever, I try
> to set "date" as time variable with the command tsset I get the
> following error message:
>
> . tsset date
> repeated time values in sample
>
> Since this is an event study I will have repeated/overlapping dates in
> my data set which is unavoidable. However there is NO repetition of
> the same dates within any single id set. Thus, is there any way to set
> a time variable for subsamples within a large data set such as
>
> "by id: tsset date"?
>
> The above obviously does not work but I hope that it somehow describes
> what I need. Any help would be appreciated.
>
>
> Best,
>
> Kaspar
>
> *
> * 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/
>
*
* 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/