Hello
I am trying to automate labeling mutliple graphs.
#delimit;
global dvlist Assembly Public Corruption Freedom v2cltort v2clkill polrights civilliberties FreePress ReligFreedom ;
foreach i of global dvlist {;
if `i'==Public {; local j = "Public Goods";};
else if `i'==Corruption {; local j = "Corruption";};
else if `i'==Assembly {; local j = "Assembly";};
else if `i'==Freedom {; local j = "Freedom";};
else if `i'==v2cltort {; local j = "Freedom from Torture";};
else if `i'==v2clkill {; local j = "Freedom from Political Killing";};
else if `i'==polrights {; local j = "Political Rights";};
else if `i'==civilliberties {; local j = "Civil Rights";};
else if `i'==FreePress {; local j = "Press Freedom";};
else if `i'==ReligFreedom {; local j = "Religious Freedom";};
display "`i' `j'";};
Using the following code I get the following output
Assembly Public Goods
Public Public Goods
Corruption Corruption
Freedom Public Goods
v2cltort Freedom from Torture
v2clkill Freedom from Political Killing
polrights Public Goods
civilliberties Public Goods
FreePress Public Goods
ReligFreedom Religious Freedom
I do not understand why j defaults to "Public goods" in some cases and takes the correct label in others. None of the variable name are abbreviated.
Any help in getting this to run would be appreciated.
I am trying to automate labeling mutliple graphs.
#delimit;
global dvlist Assembly Public Corruption Freedom v2cltort v2clkill polrights civilliberties FreePress ReligFreedom ;
foreach i of global dvlist {;
if `i'==Public {; local j = "Public Goods";};
else if `i'==Corruption {; local j = "Corruption";};
else if `i'==Assembly {; local j = "Assembly";};
else if `i'==Freedom {; local j = "Freedom";};
else if `i'==v2cltort {; local j = "Freedom from Torture";};
else if `i'==v2clkill {; local j = "Freedom from Political Killing";};
else if `i'==polrights {; local j = "Political Rights";};
else if `i'==civilliberties {; local j = "Civil Rights";};
else if `i'==FreePress {; local j = "Press Freedom";};
else if `i'==ReligFreedom {; local j = "Religious Freedom";};
display "`i' `j'";};
Using the following code I get the following output
Assembly Public Goods
Public Public Goods
Corruption Corruption
Freedom Public Goods
v2cltort Freedom from Torture
v2clkill Freedom from Political Killing
polrights Public Goods
civilliberties Public Goods
FreePress Public Goods
ReligFreedom Religious Freedom
I do not understand why j defaults to "Public goods" in some cases and takes the correct label in others. None of the variable name are abbreviated.
Any help in getting this to run would be appreciated.
Comment