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
Generating a var based on a factor in entire datasetHello, My dataset contains minute by minute stock market data for 200 companies AND if there was an…
Table with string valuesHello, I have a table for 3 numeric variables by 3 groups: tabstat var1 var2 var3, by(group) V…
replace variable values if it does not satisfy a certain conditionHello, I want all the observations of the variable "Website" to start with "www.". As shown below, m…
Find and Replace in Selection Stata (17) for MacIs the find and replace *in selected text* function available for State 17 in Mac? This post implies…
totals in tabout don't matchHi! I'm following the beneficial and good guide "Publication quality tables in Stata: a tutorial fo…
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