Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: RE: AW: AW: confirm
From
"Nick Cox" <[email protected]>
To
<[email protected]>
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
[email protected]
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/