Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: using different macros everytime


From   Martin Weiss <martin.weiss@uni-tuebingen.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using different macros everytime
Date   Sat, 14 Jun 2008 16:55:13 +0200

Just a remark: are you sure you want to reference a -local- with the $ sign? I do not think that this will actually work...

Zitat von Shehzad Ali <sia500@york.ac.uk>:


Hi,

This is probably a very simple question but just reflects my
inexperience of using foreach loops.

I want to run a 2 separate treatreg models with the same y var but
different set of x vars. Here is what I am doing:

* First model:

local xvar "x1 x2"  local zvar "x1 x2 v1"

treatreg y1 $xvars, treat(y2=$zvars)

* Second model:

local xvar "x1 x2 x3"  local zvar "x1 x2 x3 v1"

treatreg y1 $xvars, treat(y2=$zvars)

Now I want to loop this somehow so that I just write the - treatreg -
line once but - foreach - can pick up different sets of macros. Can you
suggest the best way to do it?

Thank you,

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



*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index