Hi dear profs and colleagues,

I am going to create the native_districts_constant variable. The variable is "metro".
I use this code:
Code:
label define  metroo 1  "Centro-Lisboa" 0 "other"
label values metro metroo
decode metro, gen(metarea_str)
replace metarea_str=proper( metarea_str)
split metarea_str, p(,)
drop metarea_str
replace metarea_str =upper(metarea_str)
egen metarea_str=concat(metarea_str1 metarea_str2), p(",")
BUT it says:variable metarea_str2 not found, it is supposed to be but is not. Could anyone have a look at my code to see what is missing? Thank you so much.
Code:
 egen metarea_str=concat(metarea_str1 metarea_str2), p(",")
variable metarea_str2 not found
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float metro
1
1
0
1
1
1
0
1
0
1
0
1
0
1
1
0
0
0
1
0
1
1
0
1
0
1
1
1
1
0
1
0
0
1
0
end
label values metro metroo
label def metroo 0 "other", modify
label def metroo 1 "Centro-Lisboa", modify
Cheers,
Paris