Hi, I'm having trouble in running a foreach loop and it keeps showing the invalid name error to me. The commands I used are as following:
global NEWIVB "rfriend hfriend trelat rrelat hrelat"
foreach newivb of global `NEWIVB' {
ta `newivb'
ta `newivb', nolabel
recode `newivb' (1 = 3) (3 = 1) (4 = 0), gen(`newivb'_new)
ta `newivb'_new
}
And the error is like this below:
{ invalid name
r(198);
I'm not quiet sure if I type something wrong here and I'm wondering if anyone could give me a hint on that? Thank you so much!
Related Posts with Invalid name error in foreach loop
Bysort Qualifying PartsI’m trying to find which qualifying part was treated after the first visit for the 2nd and 3rd visit…
Postfile __000000 already existsHi I am running Stata 15.1 on a Windows 7 8 core desktop. I am trying to run postfile but keep gett…
Omitted independent variables in xtabond2 using twostep system GMMHi, I am trying my data set in two-step System GMM, three variables annual GDP growth rate, Bond mar…
Assumptions SLRHi everyone, I ran a regress model, but when I checked for the assumptions, they were all violated.…
Creating interaction terms between a group of year dummies and a group of product dummies and how to use them in a regression equation.Hello, I have a challenge with how to create a kind of interaction terms for purposes of running a …
Subscribe to:
Post Comments (Atom)
0 Response to Invalid name error in foreach loop
Post a Comment