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
Sample size for equivalence trial for cluster randomized trialI want to calculate the required sample size for an equivalence trial, which is a sub-trial within t…
teffects ipwra and diff-in-diff with inverse probability weightingI am evaluating the impact of a project with NON-RANDOMIZED multiple interventions (3 treatment grou…
Harmonizing region codes across survey wavesI have four survey waves of data for individuals with a variable on the region they live in "region_…
mnsp command to use twang with stataHi everybody, I am trying to use the mnps command in stata to access twang to generate propensity sc…
Controlling the format of scalars in return listIs there a way of controlling how scalars in the return list of a function are displayed, i.e. their…
Subscribe to:
Post Comments (Atom)
0 Response to Can't rename variable to macro
Post a Comment