Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: my code for event study


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: my code for event study
Date   Thu, 15 Mar 2007 06:58:37 +0000 (GMT)

Michael Blasnik's response seems most promising: try to switch to in
instead of if. How to do that depends on how your data is structured.

--- Nian Huang <[email protected]> wrote:

> I want to thank everybody for their previous quick responses.
> 
> Here is my piece of code for event study. Basically, I get it from
> the
> Stata sample program.
> 
> 
> forvalues i=1(1)1314 {
> 	quietly reg ret mkt if id==`i' & est_window==1
> 	quietly predict p if id==`i'
> 	quietly replace pred_rtn= p if id==`i' & event_window==1
> 	quietly drop p
> }
> 
> The above program took 30 minutes to run through. Is there any way to
> improve it?
> 
> Appreciate your input!
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


		
___________________________________________________________ 
All New Yahoo! Mail � Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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