Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: AW: AW: confirm


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: AW: AW: confirm
Date   Wed, 18 Aug 2010 18:22:36 +0100

I think you're right. It is more transparent. 

Nick 
n.j.cox@durham.ac.uk 

Sergiy Radyakin

Or also:
local I = string(`i',"%02.0f")
IMHO it is somewhat more readable

Nick Cox 

> It's entirely a side issue, but it is easy to avoid spelling out 01, 02, 03, ..., 09. You just map integers to integers displayed in leading zero format:
>
> forval i = 1/31 {
>        local I : di %02.0f `i'
>        <code using `I'>
> }
>
> For more detail, if desired, see (despite the title)
>
> SJ-10-1 pr0051  . . . . . . . . . . . . Stata tip 85: Looping over nonintegers
>        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
>        Q1/10   SJ 10(1):160--163                                (no commands)
>        tip on using forvalues to loop over numbers
>
> Nick

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index