Hi all,
I'm trying to run the following code where I try renaming a variable to a macro but it keeps failing.
foreach test in $Tests {
use "$crosswalk_path" if lcd == "`test'", clear
local testname = test[1]
capture noisily {
use "$data_extract_dir/`test'.dta", clear
merge m:1 msa date using "$data_extract_dir/Data.dta", ///
preserve
rename result `testname'
restore
}
}
The error message I keep getting is Syntax is rename oldname newname [, renumber[(#)] addnumber[(#)] sort ...] rename (oldnames) (newnames) [, renumber[(#)] addnumber[(#)] sort ...] rename oldnames , {upper|lower|proper}.
Can anyone help me fix this?
Related Posts with Can't rename variable to macro
Is it okay to use multiple imputation to create imputed values in a second dataset?Say I have two datasets A & B. They have the same variables in each except that set A has one ad…
Creating Lead variables with respect to month (1, 3, 6) when I have daily datahello. I'm working on the U.S. stock market. I have entire stock market data ( thousands of stocks).…
Univariate analysisHello, So I want to apply this univariate test, subdividing my sample into high and low groups by t…
Using outreg2 to export Heckman results to LaTeXHi, I'm having problems using outreg2 to export the results from a Heckman model to LaTeX (same prob…
Productivity effectsDear Statalist users, I am trying to examine the impact of export participation of the firm on firm…
Subscribe to:
Post Comments (Atom)
0 Response to Can't rename variable to macro
Post a Comment