The data I am detailing with pertains to the household and individual-level data from the National Sample Survey, India round 64 (2007-08). There are 7 blocks containing a specific set of responses associated with a household or an individual member of a household. While the other blocks are individual level/Household level data sets, this block has consumption item codes as the unit of observation (i.e. Value of consumption in 30 days and 365 days) among other variables. I am confused with regards to how to use the reshape data format (long to wide) so that I can convert the existing format to an individual/household format so that these can be merged with the individual level datasets.
Code:
Example generated by -dataex-. To install: ssc install dataex clear input str11 Key_memb str9 Key_HH str2 Rec_id str3 C_R_S str4 FOD_Sub_Region str5 FSU str1 Ss_stratum str2(Sample_hhold_No Srl_no) long(Value_consmpn30 Value_consmpn365) "11000110101" "110001101" "07" "G4D" "2012" "11000" "1" "01" "01" 1300 . "11000110102" "110001101" "07" "G4D" "2012" "11000" "1" "01" "02" 190 . "11000110103" "110001101" "07" "G4D" "2012" "11000" "1" "01" "03" 380 . "11000110104" "110001101" "07" "G4D" "2012" "11000" "1" "01" "04" 210 . "11000110105" "110001101" "07" "G4D" "2012" "11000" "1" "01" "05" 430 . "11000110106" "110001101" "07" "G4D" "2012" "11000" "1" "01" "06" 85 . "11000110107" "110001101" "07" "G4D" "2012" "11000" "1" "01" "07" 115 . "11000110108" "110001101" "07" "G4D" "2012" "11000" "1" "01" "08" 350 . "11000110109" "110001101" "07" "G4D" "2012" "11000" "1" "01" "09" 180 . "11000110110" "110001101" "07" "G4D" "2012" "11000" "1" "01" "10" 525 . "11000110111" "110001101" "07" "G4D" "2012" "11000" "1" "01" "11" 150 . "11000110112" "110001101" "07" "G4D" "2012" "11000" "1" "01" "12" 410 . "11000110113" "110001101" "07" "G4D" "2012" "11000" "1" "01" "13" 800 . "11000110114" "110001101" "07" "G4D" "2012" "11000" "1" "01" "14" 380 . "11000110115" "110001101" "07" "G4D" "2012" "11000" "1" "01" "15" 70 . "11000110116" "110001101" "07" "G4D" "2012" "11000" "1" "01" "16" 5575 . "11000110118" "110001101" "07" "G4D" "2012" "11000" "1" "01" "18" . 9750 "11000110119" "110001101" "07" "G4D" "2012" "11000" "1" "01" "19" . 6190 "11000110120" "110001101" "07" "G4D" "2012" "11000" "1" "01" "20" . 2250 "11000110121" "110001101" "07" "G4D" "2012" "11000" "1" "01" "21" . 18190 "11000110122" "110001101" "07" "G4D" "2012" "11000" "1" "01" "22" 1495 . "11000110123" "110001101" "07" "G4D" "2012" "11000" "1" "01" "23" 7070 . "11000110201" "110001102" "07" "G4D" "2012" "11000" "1" "02" "01" 420 . "11000110202" "110001102" "07" "G4D" "2012" "11000" "1" "02" "02" 100 . "11000110203" "110001102" "07" "G4D" "2012" "11000" "1" "02" "03" 570 . "11000110204" "110001102" "07" "G4D" "2012" "11000" "1" "02" "04" 180 . "11000110205" "110001102" "07" "G4D" "2012" "11000" "1" "02" "05" 450 . "11000110206" "110001102" "07" "G4D" "2012" "11000" "1" "02" "06" 200 . "11000110207" "110001102" "07" "G4D" "2012" "11000" "1" "02" "07" 190 . "11000110208" "110001102" "07" "G4D" "2012" "11000" "1" "02" "08" 200 . "11000110210" "110001102" "07" "G4D" "2012" "11000" "1" "02" "10" 550 . "11000110211" "110001102" "07" "G4D" "2012" "11000" "1" "02" "11" 120 . "11000110212" "110001102" "07" "G4D" "2012" "11000" "1" "02" "12" 100 . "11000110213" "110001102" "07" "G4D" "2012" "11000" "1" "02" "13" 150 . "11000110214" "110001102" "07" "G4D" "2012" "11000" "1" "02" "14" 360 . "11000110216" "110001102" "07" "G4D" "2012" "11000" "1" "02" "16" 3590 . "11000110218" "110001102" "07" "G4D" "2012" "11000" "1" "02" "18" . 3800 "11000110219" "110001102" "07" "G4D" "2012" "11000" "1" "02" "19" . 4500 "11000110220" "110001102" "07" "G4D" "2012" "11000" "1" "02" "20" . 500 "11000110221" "110001102" "07" "G4D" "2012" "11000" "1" "02" "21" . 8800 "11000110222" "110001102" "07" "G4D" "2012" "11000" "1" "02" "22" 723 . "11000110223" "110001102" "07" "G4D" "2012" "11000" "1" "02" "23" 4313 . "11000120101" "110001201" "07" "G4D" "2012" "11000" "2" "01" "01" 350 . "11000120102" "110001201" "07" "G4D" "2012" "11000" "2" "01" "02" 65 . "11000120103" "110001201" "07" "G4D" "2012" "11000" "2" "01" "03" 270 . "11000120104" "110001201" "07" "G4D" "2012" "11000" "2" "01" "04" 90 . "11000120105" "110001201" "07" "G4D" "2012" "11000" "2" "01" "05" 220 . "11000120107" "110001201" "07" "G4D" "2012" "11000" "2" "01" "07" 54 . "11000120108" "110001201" "07" "G4D" "2012" "11000" "2" "01" "08" 135 . "11000120109" "110001201" "07" "G4D" "2012" "11000" "2" "01" "09" 80 . "11000120110" "110001201" "07" "G4D" "2012" "11000" "2" "01" "10" 220 . "11000120111" "110001201" "07" "G4D" "2012" "11000" "2" "01" "11" 120 . "11000120112" "110001201" "07" "G4D" "2012" "11000" "2" "01" "12" 245 . "11000120113" "110001201" "07" "G4D" "2012" "11000" "2" "01" "13" 330 . "11000120114" "110001201" "07" "G4D" "2012" "11000" "2" "01" "14" 120 . "11000120115" "110001201" "07" "G4D" "2012" "11000" "2" "01" "15" 60 . "11000120116" "110001201" "07" "G4D" "2012" "11000" "2" "01" "16" 2359 . "11000120118" "110001201" "07" "G4D" "2012" "11000" "2" "01" "18" . 40 "11000120119" "110001201" "07" "G4D" "2012" "11000" "2" "01" "19" . 2850 "11000120120" "110001201" "07" "G4D" "2012" "11000" "2" "01" "20" . 400 "11000120121" "110001201" "07" "G4D" "2012" "11000" "2" "01" "21" . 3290 "11000120122" "110001201" "07" "G4D" "2012" "11000" "2" "01" "22" 270 . "11000120123" "110001201" "07" "G4D" "2012" "11000" "2" "01" "23" 2629 . "11000120201" "110001202" "07" "G4D" "2012" "11000" "2" "02" "01" 450 . "11000120202" "110001202" "07" "G4D" "2012" "11000" "2" "02" "02" 150 . "11000120203" "110001202" "07" "G4D" "2012" "11000" "2" "02" "03" 520 . "11000120204" "110001202" "07" "G4D" "2012" "11000" "2" "02" "04" 210 . "11000120205" "110001202" "07" "G4D" "2012" "11000" "2" "02" "05" 400 . "11000120206" "110001202" "07" "G4D" "2012" "11000" "2" "02" "06" 380 . "11000120207" "110001202" "07" "G4D" "2012" "11000" "2" "02" "07" 80 . "11000120208" "110001202" "07" "G4D" "2012" "11000" "2" "02" "08" 65 . "11000120210" "110001202" "07" "G4D" "2012" "11000" "2" "02" "10" 560 . "11000120211" "110001202" "07" "G4D" "2012" "11000" "2" "02" "11" 120 . "11000120212" "110001202" "07" "G4D" "2012" "11000" "2" "02" "12" 180 . "11000120213" "110001202" "07" "G4D" "2012" "11000" "2" "02" "13" 200 . "11000120214" "110001202" "07" "G4D" "2012" "11000" "2" "02" "14" 370 . "11000120215" "110001202" "07" "G4D" "2012" "11000" "2" "02" "15" 450 . "11000120216" "110001202" "07" "G4D" "2012" "11000" "2" "02" "16" 4135 . "11000120218" "110001202" "07" "G4D" "2012" "11000" "2" "02" "18" . 1500 "11000120219" "110001202" "07" "G4D" "2012" "11000" "2" "02" "19" . 4000 "11000120220" "110001202" "07" "G4D" "2012" "11000" "2" "02" "20" . 800 "11000120221" "110001202" "07" "G4D" "2012" "11000" "2" "02" "21" . 6300 "11000120222" "110001202" "07" "G4D" "2012" "11000" "2" "02" "22" 518 . "11000120223" "110001202" "07" "G4D" "2012" "11000" "2" "02" "23" 4653 . "11000120301" "110001203" "07" "G4D" "2012" "11000" "2" "03" "01" 800 . "11000120302" "110001203" "07" "G4D" "2012" "11000" "2" "03" "02" 120 . "11000120303" "110001203" "07" "G4D" "2012" "11000" "2" "03" "03" 350 . "11000120304" "110001203" "07" "G4D" "2012" "11000" "2" "03" "04" 150 . "11000120305" "110001203" "07" "G4D" "2012" "11000" "2" "03" "05" 370 . "11000120306" "110001203" "07" "G4D" "2012" "11000" "2" "03" "06" 60 . "11000120307" "110001203" "07" "G4D" "2012" "11000" "2" "03" "07" 90 . "11000120308" "110001203" "07" "G4D" "2012" "11000" "2" "03" "08" 230 . "11000120309" "110001203" "07" "G4D" "2012" "11000" "2" "03" "09" 90 . "11000120310" "110001203" "07" "G4D" "2012" "11000" "2" "03" "10" 380 . "11000120311" "110001203" "07" "G4D" "2012" "11000" "2" "03" "11" 140 . "11000120312" "110001203" "07" "G4D" "2012" "11000" "2" "03" "12" 320 . "11000120313" "110001203" "07" "G4D" "2012" "11000" "2" "03" "13" 400 . "11000120314" "110001203" "07" "G4D" "2012" "11000" "2" "03" "14" 410 . "11000120315" "110001203" "07" "G4D" "2012" "11000" "2" "03" "15" 80 . "11000120316" "110001203" "07" "G4D" "2012" "11000" "2" "03" "16" 3990 . end
Thanks!
0 Response to Reshaping data long to wide(NSS, 64th round)
Post a Comment