Sorry, typo correction:
forval t = 1/`Tx' {
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: 16 June 2008 10:15
To: [email protected]
Subject: RE: st: using different macros everytime
Going back to your original example:
local xset `" "x1 x2" "x1 x2 x3" "'
local zset `" "x1 x2 v1" "x1 x2 x3 v1" "'
* start of stuff for program or do file only
local Tx : word count `xset'
local Tz : word count `zset'
if `Tx' != `Tz' {
di as err "no go; numbers of x sets and z sets do not match"
exit 498
}
* end of stuff for program or do file only
forval t = 1/`T' {
local x : word `t' of `xset'
local z : word `t' of `zset'
treatreg y1 `x', treat(y2 = `z')
}
I can't see much advantage in doing it this way unless the number of
sets is much larger than in the example.
Nick
[email protected]
*
* 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/