Tuesday, April 2, 2019

String variable in Do-file

Noob question:

I need to use a string variable in the name of other variables. I thought of something like:

gen country="EU"
gen netexport_"country"=ex_"country" - im_"country"

It is just an example to illustrate my problem. A loop would be sub-optimal.

No comments:

Post a Comment