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,
Related Posts with Local variable list macro is giving error
Time Series RegressionHi all, I'm working on the following sample. Code: * Example generated by -dataex-. To install: s…
Listing values and labelsI have a bunch of countries. They are coded as numbers (values) in an integer variable. For each val…
Time-series analysisHello everyone! I want to create a graph base on several rounds of ESS survey years. I have immigra…
confidence interval for mean differenceDear Listers, I would like to know how to capture confidence interval for mean difference. I have …
Collapse with percentage of population in a dummy variable wrt region and yearHi everyone, I am currently working with data of following Format Year Region Dummy 2001 11 0 2001…
Subscribe to:
Post Comments (Atom)
0 Response to Local variable list macro is giving error
Post a Comment