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

RE: st: RE: Re: statalist-digest V4 #1868


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: Re: statalist-digest V4 #1868
Date   Mon, 31 Jan 2005 10:09:17 -0000

prelist is born empty, or so the code 
fragment presumes, but each time 
round the loop it accretes the latest 
name assigned by the preceding -tempvar-. 

The double quotes are just a matter of style
on my part, as I like to underline to myself 
-- and to any readers of the code -- that
the string interpretation is paramount. 
As you say, it would work without them. 

Nick 
[email protected] 

Joseph Coveney
 
> Nick Cox wrote (excerpted):
> 
> use auto.dta, clear
> ologit rep78 price turn
> forval j = 1/`e(k_cat)' { 
> 	tempvar pre
> 	local prelist "`prelist' `pre'" 
> }
> predict `prelist'  
> 
> --------------------------------------------------------------
> -----------------
> 
> Nick,
> 
> You put the double quotes in -local prelist "`prelist' 
> `pre'"- for a purpose.  
> The code works at least in this case without them, and so I'm 
> curious why you 
> included them, what the potential pitfall is that they're 
> there to guard against.
 

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