Hello Everyone.
I am working with the DHS data. The data that I have below shows hhid, the number of eligible children in the HHs(hv014), and the BMI's of the children in that HHs. I want to arrange the data such that I want to keep only a single column for all the BMI's.
This is what I want the data to look like.
Example
HHID hv014 BMI's
111 0 .
112 2 .
113 2 15.9
113 2 17.8
120 3 14.65
120 3 17.49
120 3 19.009
ORIGINAL DATA
Please help me with it.
THANKS
I am working with the DHS data. The data that I have below shows hhid, the number of eligible children in the HHs(hv014), and the BMI's of the children in that HHs. I want to arrange the data such that I want to keep only a single column for all the BMI's.
This is what I want the data to look like.
Example
HHID hv014 BMI's
111 0 .
112 2 .
113 2 15.9
113 2 17.8
120 3 14.65
120 3 17.49
120 3 19.009
ORIGINAL DATA
Code:
input str12 hhid byte hv014 float(bmi_01 bmi_02 bmi_03) "111" 0 . . . "112" 2 . . . "113" 2 15.90261 17.800783 . "114" 4 . . . "115" 2 . . . "116" 0 . . . "117" 0 . . . "118" 1 14.77411 . . "119" 2 16.219723 17.066282 . "120" 3 14.651367 17.49031 19.00928 "121" 7 . . . "122" 0 . . . "2 1" 2 . . . "2 2" 1 . . . "2 3" 0 . . . "2 4" 1 . . . "2 5" 0 . . . "2 7" 0 . . . "2 8" 0 . . . "2 9" 2 . . . "210" 0 . . . "211" 5 . . . "212" 2 14.107908 . . "213" 3 . . . "214" 2 13.7203 13.128113 . "215" 0 . . . "216" 0 . . . "217" 0 . . . "218" 0 . . . "221" 0 . . . "222" 0 . . . "3 2" 0 . . . "3 3" 2 . . . "3 4" 2 . . . "3 5" 2 17.407408 16.464987 . "3 6" 2 . . . "3 7" 1 15.089164 . . "3 8" 5 . . . "3 9" 4 . . . "310" 2 . . . "311" 2 . . . "312" 1 16.49102 . . "313" 1 . . . "314" 2 15.684154 15.457788 . "315" 2 13.522594 13.69613 . "316" 12 . . . "317" 2 . . . "318" 0 . . . "319" 1 15.017857 . . "320" 3 18.779316 18.125 15.370906 "321" 0 . . . "322" 3 . . . "4 2" 0 . . . "4 3" 2 . . . "4 4" 1 . . . "4 5" 5 . 16.296824 13.606987 "4 6" 0 . . . "4 7" 4 . . . "4 8" 1 16.351185 . . "4 9" 0 . . . "410" 0 . . . "411" 1 . . . "412" 1 . . . "413" 0 . . . "414" 0 . . . "415" 3 14.20412 . 18.456871 "416" 1 . . . "417" 0 . . . "418" 1 15.7193 . . "419" 0 . . . "420" 3 17.3323 . . "421" 1 . . . "422" 0 . . . "5 2" 1 . . . "5 3" 3 . . . "5 4" 5 15.112695 . 15.961038 "5 5" 0 . . . "5 6" 5 . . . "5 7" 1 15.876577 . . "5 8" 2 14.526503 . . "5 9" 3 . . . "510" 5 . . . "511" 2 15.14626 12.70304 . "512" 3 . . . "513" 2 . . . "514" 0 . . . "515" 2 . . . "516" 2 14.922585 . . "517" 3 16.890621 18.194687 . "518" 0 . . . "519" 3 . . . "520" 1 . . . "521" 2 . . . "522" 2 15.811314 15.967484 . "6 1" 1 . . . "6 2" 2 16.142904 13.97502 . "6 3" 4 . . . "6 4" 1 . . . "6 5" 2 . . . "6 6" 2 . . . end
THANKS
Comment