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(",")
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
Paris
0 Response to Problem in creating a string variable
Post a Comment