st: Re: running a foreach loop over a sequence of dates

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

st: Re: running a foreach loop over a sequence of dates

Christopher F Baum
< >
Beyond the problems with this pseudo-code, why write it in the first  
place? Why not just use -rolling-? Presumably Augusto really wants  
something other than just a huge logfile, and to save the stuff being  
produced in this loop, a little ado-file that saves the stuff he wants  
for each turn of the crank would probably be more useful.

Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


On Dec 4, 2008, at 02:33 , Augusto wrote:

>
> *** begin pseudo-code
>
> foreach t in 1992q1/2000q4 {
>        reg y L.y L.x if tin(1960q1, `t')
>        reg y L.y L.x if tin(`=`t'-20', `t')
> }
>
> *** end pseudo-code

*
*   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/