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

st: RE: re: leftist tendencies


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: re: leftist tendencies
Date   Wed, 9 Feb 2005 18:39:52 -0000

That's more elegant, apart from the typo! 
"%-%" should be "%-" 

Nick 
[email protected] 

Kit Baum 
 
> Friedrich is correct: there is an extended-macro-function 
> called format. Thus Nick's general-purpose program to make 
> every string variable left-just (better then mine, in that it 
> works on the whole dataset) can be written as
> 
> ds, has(type string)
> 
> foreach v in `r(varlist)' {
>     local f : format `v'
>     local ff : subinstr local f "%" "%-%"
>     format `v' `ff'
> }
> 
> No shorter, but more to the point.

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