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

st: RE: RE: Re: RE: Multiple commands under "By varlist"?


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Re: RE: Multiple commands under "By varlist"?
Date   Sat, 26 Jun 2004 15:26:22 +0100

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 
n.j.cox@durham.ac.uk 

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index