I am recoding lots of variables and wonder if there is a simpler way of having long variables lists with a single local macro. I need to reuse (and edit) these variable lists so I am putting them in separate do-files then calling them as needed with the include command.
Is there a way to have the var names in the list be wrapped across multiple compact lines of text -- instead of strung out across the right-hand side of the editor window in a single line?
Is there any other simple way to write the long VarList (60-90 vars) for a local macro so that it wraps across shorter lines so it is easier to deal with?
Much thanks in advance,
wg
Is there a way to have the var names in the list be wrapped across multiple compact lines of text -- instead of strung out across the right-hand side of the editor window in a single line?
- I am using Stata v14 on Windows 7 sys
- The vars I am working w are predominantly nonconsecutive, therefore it is not helpful to use conventions such as var1-var99, or var1*.
- One suggestion I found is in Long's "Workflow of Data Analysis" , where he nests the local macro name within itself multiple times -- like this:
Code:
local macroVarList "var1 var12 var34 var42 var50" local macroVarList " `macroVarList' var61 var78 var82 var93" local macroVarList " `macroVarList' var101 var111 var123 var132"
Much thanks in advance,
wg
Comment