Right. I saw your point, but I did word myself very inefficiently!
----- Original Message -----
From: "Nick Cox" <n.j.cox@durham.ac.uk>
To: <statalist@hsphsun2.harvard.edu>
Sent: Saturday, June 26, 2004 11:06 AM
Subject: st: RE: Re: RE: Re: RE: Multiple commands under "By varlist"?
> Yes and no. Sorry to repeat the point, but you
> put the blame in the wrong place again
> in talking of the inefficiency of -while-,
> which is just a framework and not to blame
> for what's inside.
>
> The ineffiency of -while- is in going (e.g.)
>
> local i = 1
> while `i' < 1000 {
> ...
> local i = `i' + 1
> }
>
> rather than (say)
>
> forval i = 1/1000 {
> ...
> }
>
> -- although note that not every -while-
> can be made a -forval- --
>
> but that's small beer compared with the
> possible inefficiency of what the user
> puts within the loop, which is the issue here.
>
> Nick
> n.j.cox@durham.ac.uk
>
> Subhankar Nayak
> >
> > Yes, that's a very interesting point that I had missed.
> > I now see why -while- is so inefficient: it reads such a huge
> > fraction of
> > unneccesary observations. I can avoid that by more efficient
> > treatment of
> > the observation: avoid reading all those unneccesary observations
> > repeatedly.
>
> *
> * 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/
>
*
* 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/