Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Avoiding loops (the while loop)


From   "Subhankar Nayak" <nayak@bellsouth.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Avoiding loops (the while loop)
Date   Fri, 25 Jun 2004 12:49:00 -0400

I want to avoid loops in the following analysis and will appreciate it if
anyone can suggest an alternative..
I have a very simple dataset...

11 variables:    (month),    (y01-y10),    and (x01-x10) for 1000 months
So, it is a 1000*11 dataset...

What I want to do is: each month, I regress (y01-y10) on (x01-x10) and store
the intercept and slope...
I need these intercept and slopes for later analysis...

What I am doing now is a while loop based on month: carry the regressions on
a monthly basis and store the results.
This seems a very inefficient way of handling this. It is taking time too,
because I have to do many similar analyses later on.

Can anyone please suggest an alternative/efficient way of accomplishing
this?

Thanks


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index