Dear all,
I have a problem when using the local and global macro.
When I set up a local macro based on variable names, then display it, what stored in the local is the data in the first row instead of the variable names. Same thing happened to global macro. The data was imported from excel file, I tried .csv file as well, didn't work either. Any idea how can I solve this?
code for importing data:
import excel using Indicator.xlsx, sheet("Sheet2") first clear
code and output for setting up local macro for all variables: Array
As shown above, the local macro stored the values of the first row of data, instead of the variable names. I tried select a list of variables manually to set up the local, same thing happened.
Will appreciate it if I can get help on this.
Many thanks,
Craig Yang
Related Posts with Local and global macro are not capturing variables' names but the values in the first row
How to concatenate a local variable with a string in StataI have a very large DO file that I need to control for whether the code is run in Linux or Windows. …
Help! Merge Compustat Security Daily and Worldscope AnnualDear Statalister, I would like to ask how to merge Compustat security daily data and Worldscope ann…
Coarsened Exact Matching with Parallel does not work properlyDear Statalisters, I use CEM with Parallel with the following command Code: parallel setclusters 4…
Advice on Panel Data usage (tests to be performed)Dear all, I will start the methodology part of my master thesis soon and would like to get your adv…
A question about computing margins for xtmelogitI am using xtmelogit in Stata 15.1 to analyze a dataset that is nested in schools. I used the code b…
Subscribe to:
Post Comments (Atom)
0 Response to Local and global macro are not capturing variables' names but the values in the first row
Post a Comment