Dear statlist team,
I would like to ask for your help with managing some large data I have. I need to generate new observations that maintain the value for all variables, while separating the "hs6s" variable following the codes separated by semicolon within.
Below a small portion of the database to illustrate it.
I should mention that the complete database includes some cells with more than 5000 different hs6 codes. I hope you can help me with this challenge.
clear
input str33 reporter strL partner str4 ntm str11 target strL hs6s
"Afghanistan" "All Members" "P14" "Target 12.4" "290314;290319;290339;380891;380892;380893;380894; 380899;381300;381400;382200;382471;382472;382473;3 82474;382475;382476;382477;382478;382479;382490"
"Afghanistan" "All Members" "P14" "Target 12.5" "290314;290319;290339;380891;380892;380893;380894; 380899;381300;381400;382200;382471;382472;382473;3 82474;382475;382476;382477;382478;382479;382490"
"Afghanistan" "All Members" "P14" "Target 12.4" "381300;841510;841520;841581;841582;841583;841590; 841810;841821;841829;841830;841840;841850;841861;8 41869;841891;841899;841960;842410;845110;847621;84 7780"
"Afghanistan" "All Members" "P14" "Target 12.5" "381300;841510;841520;841581;841582;841583;841590; 841810;841821;841829;841830;841840;841850;841861;8 41869;841891;841899;841960;842410;845110;847621;84 7780"
end
[/CODE]
I would like to ask for your help with managing some large data I have. I need to generate new observations that maintain the value for all variables, while separating the "hs6s" variable following the codes separated by semicolon within.
Below a small portion of the database to illustrate it.
I should mention that the complete database includes some cells with more than 5000 different hs6 codes. I hope you can help me with this challenge.
clear
input str33 reporter strL partner str4 ntm str11 target strL hs6s
"Afghanistan" "All Members" "P14" "Target 12.4" "290314;290319;290339;380891;380892;380893;380894; 380899;381300;381400;382200;382471;382472;382473;3 82474;382475;382476;382477;382478;382479;382490"
"Afghanistan" "All Members" "P14" "Target 12.5" "290314;290319;290339;380891;380892;380893;380894; 380899;381300;381400;382200;382471;382472;382473;3 82474;382475;382476;382477;382478;382479;382490"
"Afghanistan" "All Members" "P14" "Target 12.4" "381300;841510;841520;841581;841582;841583;841590; 841810;841821;841829;841830;841840;841850;841861;8 41869;841891;841899;841960;842410;845110;847621;84 7780"
"Afghanistan" "All Members" "P14" "Target 12.5" "381300;841510;841520;841581;841582;841583;841590; 841810;841821;841829;841830;841840;841850;841861;8 41869;841891;841899;841960;842410;845110;847621;84 7780"
end
[/CODE]
Comment