In this I referred to Michael Blasnik.
14 seconds later he posted a similar point.
Clearly this should be written up in supermarket
trash newspapers as an Amazing Coincidence.
Nick
[email protected]
Nick Cox
>
> 2. The way -if- is implemented. The
> command
>
> regress returns factor if `i' == month
>
> is implemented by testing every observation
> to see whether it should be included in
> the regression. In your case 99.9% of
> the observations are irrelevant to each
> regression, but Stata takes no special
> action to avoid that. You should be
> able to substitute -if- by -in-:
>
> gen long obsno = _n
> sort month port
> forval i = 1/1000 {
> local min = ...
> local max = ...
> regress returns factor in `min'/`max'
> ...
> }
>
> and by Blasnik's Law this should be much faster.
*
* 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/