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
Order studies within group by time in meta-analysis forest plotHi everyone I am working on a forest plot. I want to order the studies within each group by publica…
Import excel table to stataHi every one, I have problem when import data from excel. My excel table has type of: year 1 ye…
Is % bias is more important than t test results for PSM?My variable of interest is ethnicity. Ethnicity has two categories: natives or migrants. I want to s…
To append or to mergeI would like to create a long panel from the 17 waves of panel data from the HILDA survey but am str…
Rename a function?How should I rename a function in Stata? I combine Stata and R, and to reduce confusion, I’d like t…
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