Hi all!
I have a panel of countries and some macroeconomic variables and I'm trying to code a program in Stata to graph them and when I try to see if it worked I get an invalid syntax error message. More specifically, here is the program and the last line is where I'm trying to test it with two variables of my data set and a country (one of many that I've tried):
Then I get the following error:
I put a set trace on before running that last line and the error occurs exactly after I write this line (the program doesn't even start), which leads me to think the problem is in the line where I try to test the program but I'm not really sure and I can't find why would it be wrong. So any help is extremely welcome!!
I have a panel of countries and some macroeconomic variables and I'm trying to code a program in Stata to graph them and when I try to see if it worked I get an invalid syntax error message. More specifically, here is the program and the last line is where I'm trying to test it with two variables of my data set and a country (one of many that I've tried):
Code:
cap program drop graphing program define graphing version 1.0 syntax [if] [in] [, country(string) variable1(varname) variable2(varname)] preserve keep if countryname=="`country'" graph twoway (line `variable1' date)/// (line `variable2' date) graph save "${output}\Series\figure_`country'_`variable1'_`variable2'.gph ", replace restore end graphing, country("Argentina") variable1(dginz) variable2(inflows_gdp)
invalid syntax
r(198);
r(198);
Comment