Hello,
I am trying to use a basic for loop but keep getting the error 'Invalid Syntax' which I cannot figure out. The variable id has been defined.
Could anyone please tell me if they understand the reason for the syntax error. I ran the code without the for loop and using individual values and it worked.
Thanks!
I am trying to use a basic for loop but keep getting the error 'Invalid Syntax' which I cannot figure out. The variable id has been defined.
Code:
forval i=1/`id'{ preserve use if (inrange(Census2001_Lon,`minlon',`maxlon') & inrange(Census2001_Lat,`minlat',`maxlat')) using MainData save data_`id', replace restore }
Thanks!
Comment