Patience is the key.
Sorry, as Michael pointed out mean(abnor'var') should be mean(abnor`var')
Not an excuse for looking carefully enough, but does stata have something
built in to check for this?
Thanks
rajesh
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rajesh Tharyan
Sent: 17 September 2008 00:32
To: [email protected]
Subject: st: foreach problem
Hi,
Now, what could possibly be wrong with this?
foreach var of varlist deco pico {
gen abnor`var'=`var'- N`var'
sort d
by d: egen Aabnor`var'=mean(abnor'var')
}
Stata gives me
. abnor'var' invalid name
r(198);
I have already created N`var' and I can see that it exists..
Thanks
rajesh
*
* 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/
*
* 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/