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
Manipulating this data table - seems simple but I cannot think of a solutionSo I think my question is best shown with a set of pictures.
This is what my current data looks lik…
Variable type change after mergingHello Statalists,
I have a question about data merging.
I am merging two data sets together ("mast…
Multilevel multinomial model - gsem slows down considerably after adding random slopeDear statalisters,
I would very much appreciate your help with my analysis.
Dataset:
1500 responde…
What commands would be needed to create this tableI want to create a mean randomization check table for a RCT. Basically I want to generate a table li…
Predicted probabilities at specified values of case-specific variables clogitDear all,
I was estimating a conditional logit model with alternative-specific coefficients for an …
Subscribe to:
Post Comments (Atom)
0 Response to Local variable list macro is giving error
Post a Comment