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
Instrumental Variables and using xtivreg with squared termHi - I am using a panel dataset of US companies for the years 2000-19 (US Industrials - Worldscope).…
Coefficient of VariationDear all Statalist, Just an apparent easy question, even if I am having problems in computation: if…
How to plot overlaying normal distributionsHi all, I'm trying to do something for which I can't really find any previous posts. Basically, I w…
Reshape problem: values of variable j not unique within idHi all, I am trying to generate Dummy variables from a question with multiple responses. Lamentably…
Simulations: Flat log likelihood encountered, cannot find uphill directionDear community, I am trying to see how many times using the Box-Jenkins methodology I select the cor…
Subscribe to:
Post Comments (Atom)
0 Response to Local variable list macro is giving error
Post a Comment