I have three variables varA, varB and varC.
I attempted to first replace "missing" with NA in all three variables then add a label to all three variables.
First I replaced "missing" with NA:
local mylist1 varA-varC
foreach v1 of varlist `mylist1' {
replace `v1'="NA" if `v1' =="missing"
}
Now if I want to call the list again to add the same label to all three variables:
foreach v1 of varlist `mylist1' {
label var `v1' "testvaraible"
}
but I will get an error message saying :
varlist required
Could anyone explain why I can't recall the list?