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
How to use a .prn file in stataHey there, I am currently working on my bachelor thesis about economic growth and I downloaded a da…
Fama-Macbeth (1973) with a cross-sectional invariant variableDear all, How do I properly run a Fama-Macbeth regression with a cross-sectional invariant variable…
Confirmation Factor analysis with panel dataDear Statalist, I am a newbie and I were stuck for some days. I need to run CFA for a panel data w…
Dissimilarity Index for Neighborhood Level DataHello, I need to calculate a racial dissimilarity index score for each of 52 neighborhoods in my st…
Use Log(Stock Prices) or (Stock Returns)I am running a regression model to find the impact of Federal Funds Rate(FFR) on Stock market. I hav…
Subscribe to:
Post Comments (Atom)
0 Response to Invalid name error in foreach loop
Post a Comment