Hi everyone,

I am trying to use the local macro to define few variables in a group i.e.

local A var1 var2 var3
local B 'A' var4 var5 var6

However, when I run any command like
sum 'A'
or;
display 'A'

Stata gives the following error
. display 'A'
'A' invalid name
r(198);

I have looked at many other posts at Stata forum and I think many have used the macro for this task in similar way. I am not sure why the macro is not working. Is there some package needs to be installed for that to work?

Secondly, what if we have a long list of variable and we want to define a local group of these variables for descriptive statistics etc. i.e.

local A var1 var2 var3 \\\
var4 var5 var6

I have tried the above that is also not working. Or whether the following would be a good approach.

local A var1 var2 var3
local B " 'A' var1 var2 var3 "

Finally, I have read the delimit possibility. But if we use delimit would it be for whole dofile or can be used for part of dofile. I have tried that as well however to no avail. It worked from dofile but the problem is similar after local command is performed, I am unable to do anything with the list due to same invalid name error. Any help of suggestion would be much appreciated.

Regards,