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}
}
Related Posts with Forval loop invalid syntax
Sargan-Hansen testHi. I am trying to obtain results for the Sargan-Hansen test. However, when I run a regression usin…
How to spread the reference's values to other observations at different yearsDear statalist, I have a dynamic panel for 20 years. However, data on one variable of interest is c…
Applying different colors to data points in scatter plotHi! I am trying to create a graph like the one below where I can apply different colors to data poin…
Create indicator variables from multiple response string variableHi, I have a multiple response string variable, locnm_1, which lists the names of local sponsors of…
Significant OLS results but insignificant IV results and the insignificant endogeneity testDear all, I want to explore the effects of X on Y. Considering X might be an exogenous variable, I …
Subscribe to:
Post Comments (Atom)
0 Response to Forval loop invalid syntax
Post a Comment