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

st: RE: Multiple commands under "By varlist"? (A final comment)


From   "Subhankar Nayak" <nayak@bellsouth.net>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Multiple commands under "By varlist"? (A final comment)
Date   Sat, 26 Jun 2004 17:05:44 -0400

I recoded my simulation exercises ...

Initially I was using -while- loops within which there 3 lines and each line
was checking all observations of the dataset. This was clearly inefficient.
Now I adopted two variations: (1) the -forval- approach as Nick pointed out
and (2) -while- loop but cleverly jumping through groups/iterations as
Michael  suggested.

Now my simulations are atleast 12 times faster...
It is heartening to see that simulations, which used to take 8 hours or
more, are now being accomplished in about 40 minutes.

Thanks Nick and Michael.
I am learning new things everyday.

Subh


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