Sorry, I forgot a very important line of the code. Here are the commands I'm
using:
global indvar Dagesex1 Dagesex2 Dagesex4-Dagesex10 ///
x01-x16 x18-x46 adg1-adg14 adg16-adg18 adg20-adg22 ///
adg26-adg34 Drace2-Drace6 prio_7
global pbetas " "
foreach x of global indvar {
global pbetas $pbetas `x'1
}
global names "$pbetas"
corr2data $names constant1, n(10000) means(bpart1) cov(vpart1) clear
Thanks, Maria
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maria Montez
Sent: Monday, May 02, 2005 6:29 PM
To: [email protected]
Subject: st: automatically creating variables names
Hi!
On my simulation I need to create a second set of variables names because
I'm running two part models. I'm using the following commands, which are
supposed to append a one at the end of each variable name:
global indvar Dagesex1 Dagesex2 Dagesex4-Dagesex10 ///
x01-x16 x18-x46 adg1-adg14 adg16-adg18 adg20-adg22 ///
adg26-adg34 Drace2-Drace6 prio_7
foreach x of global indvar {
global pbetas $pbetas `x'1
}
However, the foreach loop does not work because I have lists of variables in
the global indvar, e.g. Dagesex4-Dagesex10.
Does anyone have a fix for this problem other then having to type each one
of the variables separately.
Thanks, Maria
*
* 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/