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" <[email protected]>
To   <[email protected]>
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 
[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/



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