Hello,
I am using forval code as below and then it says it is 'invalid syntax'. I checked that all the variables from macro with $ works fine with other codes. When I put the value of first equation without forval to check for that equation, it worked fine.
Do you see any error in this code below? thank you.
forval i = 1999/2017 {
gen com_bV`i'_1=(${Pi`i'_1}-${Pi`i'-1_1})*${rg`i'_1}
gen com_bV`i'_2=(${Pi`i'_2}-${Pi`i'-1_2})*${rg`i'_2}
}
I am using forval code as below and then it says it is 'invalid syntax'. I checked that all the variables from macro with $ works fine with other codes. When I put the value of first equation without forval to check for that equation, it worked fine.
Do you see any error in this code below? thank you.
forval i = 1999/2017 {
gen com_bV`i'_1=(${Pi`i'_1}-${Pi`i'-1_1})*${rg`i'_1}
gen com_bV`i'_2=(${Pi`i'_2}-${Pi`i'-1_2})*${rg`i'_2}
}
Comment