***************************************************************************************** * Stata program for the conversion of data from the India NSS59 survey * from ASCII format to Stata format. * This program converts data from Schedule 1.0 and adds variables and value labels. * * Author: Akiko Sagesaka, World Bank Data Group (Jun. 2013) ***************************************************************************************** clear set more off #delimit ; global pathin "L:\HHS\Datalib\India\IND_2003_NSS59-SCH1.0\IND_2003_NSS59-SCH1.0_v01_M\Data\Original"; global pathout "L:\HHS\Datalib\India\IND_2003_NSS59-SCH1.0\IND_2003_NSS59-SCH1.0_v01_M\Data\Stata"; tempfile temp0 temp1 temp2 temp3 temp4 temp5 temp6 temp7 temp8; ***************************************************************; * SCHEDULE 1 - LEVEL 1 (Blocks 1 & 2) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B1_v16 41 - 42 str B1_v17 43 - 43 str B1_v18 44 - 44 str B1_v19 45 - 45 str B2_v2a 46 - 51 str B2_v2b 52 - 57 str B2_v4 58 - 60 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="01"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B1_v16 "Sl.No. of informant"; label variable B1_v17 "Response Code"; label variable B1_v18 "Survey Code"; label variable B1_v19 "Substitution Code"; label variable B2_v2a "Date of Survey"; label variable B2_v2b "Date of Despatch"; label variable B2_v4 "Time to canvass(mins.)"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label define RespCode 1 "Informant co-operative and capable" 2 "Informant co-operative but not capable" 3 "Informant busy" 4 "Informant reluctant" 9 "Others"; label define SurvCode 1 "Original" 2 "Substitute" 3 "Casualty"; label define subst 1 "Informant busy" 2 "Members away from home" 3 "Informant non-cooperative" 9 "Others"; label values state state; label values B1_v4 sample; label values B1_v5 sector; label values B1_v17 RespCode; label values B1_v18 SurvCode; label values B1_v19 subst; sort hhid; save "$pathout\NSS59_Sch1_bk_1_2", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 2 (Blocks 3 & 10) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B3_v1 41 - 42 str B3_v2 43 - 47 str B3_v3 48 - 50 str B3_v4 51 - 51 str B3_v5 52 - 52 str B3_v6 53 - 53 str B3_v7 54 - 55 str B3_v8 56 - 56 str B3_v9 57 - 57 str B3_v10 58 - 58 str B3_v11 59 - 64 str B3_v12 65 - 66 str B3_v13 67 - 67 str B3_v14 68 - 68 str B3_v15 69 - 69 str B3_v16 70 - 70 str B3_v17 71 - 78 str B10_v1 79 - 79 str B10_v2a 80 - 81 str B10_v2b 82 - 83 str B10_v2c 84 - 85 str B10_v2d 86 - 87 str B10_v2e 88 - 89 str B10_v2f 90 - 91 str B10_v2g 92 - 93 str B10_v2h 94 - 95 str B10_v2i 96 - 97 str B10_v2j 98 - 99 str B10_v2k 100 - 101 str B10_v3 102 - 102 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="02"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; gen B3_v4a=B1_v5*10+B3_v4; replace B3_v17=B3_v17/100; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B3_v1 "HHS Size"; label variable B3_v2 "NIC Code(5-digit)"; label variable B3_v3 "NCO Code(3-digit)"; label variable B3_v4 "HHS type"; label variable B3_v4a "HHS type"; label variable B3_v5 "Religion"; label variable B3_v6 "Social Group"; label variable B3_v7 "Land Possessed"; label variable B3_v8 "Dwelling unit"; label variable B3_v9 "Type of Dwelling"; label variable B3_v10 "Type of Structure"; label variable B3_v11 "Covered Area"; label variable B3_v12 "Cooking"; label variable B3_v13 "Lighting"; label variable B3_v14 "Whether Meals outside?"; label variable B3_v15 "Whether Ceremony?"; label variable B3_v16 "Whether Ration?"; label variable B3_v17 "MPCE"; label variable B10_v1 "Whether Enough food?"; label variable B10_v2a "Month code when not enough food"; label variable B10_v2b "Month code when not enough food"; label variable B10_v2c "Month code when not enough food"; label variable B10_v2d "Month code when not enough food"; label variable B10_v2e "Month code when not enough food"; label variable B10_v2f "Month code when not enough food"; label variable B10_v2g "Month code when not enough food"; label variable B10_v2h "Month code when not enough food"; label variable B10_v2i "Month code when not enough food"; label variable B10_v2j "Month code when not enough food"; label variable B10_v2k "Month code when not enough food"; label variable B10_v3 "Whether Question1 actually asked?"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label define B3_v4a 11 "Self-employed in non-agriculture" 12 "Agricultural labour" 13 "Other labour" 14 "Self-employed in agriculture" 19 "Others" 21 "Self-employed" 22 "Regular wage/salary earning" 23 "Casual labour" 29 "Others"; label values state state; label values B1_v4 sample; label values B1_v5 sector; order hhid state B1_v0 B1_v1 B1_v2 B1_v3 B1_v4 B1_v5 B1_v6 B1_v7 B1_v8 B1_v9 B1_v10 B1_v11 B1_v12 B1_v13 B1_v14 B1_v15 Level B3_v1 B3_v2 B3_v3 B3_v4 B3_v4a B3_v5 B3_v6 B3_v7 B3_v8 B3_v9 B3_v10 B3_v11 B3_v12 B3_v13 B3_v14 B3_v15 B3_v16 B3_v17 B10_v1 B10_v2a B10_v2b B10_v2c B10_v2d B10_v2e B10_v2f B10_v2g B10_v2h B10_v2i B10_v2j B10_v2k B10_v3 NSS NSC MLT hhwt; sort hhid; save "$pathout\NSS59_Sch1_bk_3_10", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 3 (Block 4) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B4_v1 36 - 40 str B4_v3 41 - 41 str B4_v4 42 - 42 str B4_v5 43 - 44 str B4_v6 45 - 45 str B4_v7 46 - 47 str B4_v8 48 - 49 str B4_v9 50 - 51 str B4_v10 52 - 53 str B4_v11 54 - 55 str B4_v12 56 - 57 str B4_v13 58 - 59 str B4_v14 60 - 61 str B4_v15 62 - 62 str B4_v16 63 - 64 str B4_v17 65 - 66 str B4_v18 67 - 68 str B4_v19 69 - 70 str B4_v20 71 - 72 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="03"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B4_v1 "Person Srl No."; label variable B4_v3 "Relation"; label variable B4_v4 "Sex"; label variable B4_v5 "Age"; label variable B4_v6 "Marital Status"; label variable B4_v7 "Education"; label variable B4_v8 "Usual Activity. Principal Status"; label variable B4_v9 "Usual Activity. Principal NIC code"; label variable B4_v10 "Usual Activity. Subsidiary Status"; label variable B4_v11 "Usual Activity. Subsidiary NIC code"; label variable B4_v12 "Weekly Activity. Status"; label variable B4_v13 "Weekly Activity NIC code"; label variable B4_v14 "Days Stayed away"; label variable B4_v15 "No. of Meals per day"; label variable B4_v16 "Meals (School)"; label variable B4_v17 "Meals (Employer)"; label variable B4_v18 "Meals (Others)"; label variable B4_v19 "Meals (Payment)"; label variable B4_v20 "Meals(At Home)"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label values state state; label values B1_v4 sample; label values B1_v5 sector; sort hhid B4_v1; save "$pathout\NSS59_Sch1_bk_4", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 4 (Blocks 5 & 5.1) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B5_v1 36 - 40 str B5_v3 41 - 48 str B5_v4 49 - 56 str B5_v5 57 - 57 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="04"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace force; format hhid %15.0g; replace B5_v3=B5_v3/100; replace B5_v4=B5_v4/100; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B5_v1 "Item Code"; label variable B5_v3 "Quantity"; label variable B5_v4 "Value"; label variable B5_v5 "Source Code"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label values state state; label values B1_v4 sample; label values B1_v5 sector; sort hhid B5_v1; save "$pathout\NSS59_Sch1_bk_5_5-1", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 5 (Blocks 6 & 7) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B6_v1 36 - 40 str B6_v3 41 - 48 str B6_v4 49 - 56 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="05"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; replace B6_v3=B6_v3/100 if inrange(B6_v1,360,389); replace B6_v4=B6_v4/100; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B6_v1 "Item Code"; label variable B6_v3 "Quantity"; label variable B6_v4 "Value"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label values state state; label values B1_v4 sample; label values B1_v5 sector; sort hhid B6_v1; save "$pathout\NSS59_Sch1_bk_6_7", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 6 (Blocks 8.1 & 8.2) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B8_v1 36 - 40 str B8_v3 41 - 48 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="06"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; replace B8_v3=B8_v3/100; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B8_v1 "Item Code"; label variable B8_v3 "Value"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label values state state; label values B1_v4 sample; label values B1_v5 sector; sort hhid B8_v1; save "$pathout\NSS59_Sch1_bk_8-1_8-2", replace; ***************************************************************; * SCHEDULE 1 - LEVEL 7 (Block 9) ; ***************************************************************; forvalues i=1/8 {; drop _all; infix str B1_v0 1 - 3 str B1_v1 4 - 8 str B1_v2 9 - 10 str B1_v3 11 - 13 str B1_v4 14 - 14 str B1_v5 15 - 15 str B1_v6 16 - 18 str B1_v7 19 - 20 str B1_v8 21 - 22 str B1_v9 23 - 23 str B1_v10 24 - 24 str B1_v11 25 - 28 str B1_v12 29 - 29 str B1_v13 30 - 30 str B1_v14 31 - 31 str B1_v15 32 - 33 str Level 34 - 35 str B9_v1 36 - 40 str B9_v3 41 - 43 str B9_v4 44 - 46 str B9_v5 47 - 47 str B9_v6 48 - 55 str B9_v7 56 - 63 str B9_v8 64 - 66 str B9_v9 67 - 74 str B9_v10 75 - 82 str NSS 127 - 129 str NSC 130 - 132 str MLT 133 - 142 using "$pathin\IH`i'10.TXT"; keep if Level=="07"; gen hhid= B1_v1+B1_v12+B1_v13+B1_v14+B1_v15; gen state=substr(B1_v6,1,2); destring MLT, replace; order hhid state *; gen hhwt=MLT/200 if NSC > NSS; replace hhwt=MLT/100 if hhwt==.; compress; save `temp`i'', replace; }; use `temp1', clear; forvalues i=2/8 {; append using `temp`i''; }; destring *, replace; format hhid %15.0g; label variable hhid "Household ID"; label variable state "State"; label variable B1_v0 "Centre code,Round,Shift"; label variable B1_v1 "LOT/FSU number"; label variable B1_v2 "Round"; label variable B1_v3 "Schedule"; label variable B1_v4 "Sample"; label variable B1_v5 "Sector"; label variable B1_v6 "State-Region"; label variable B1_v7 "Dilabel variableict"; label variable B1_v8 "label variableatum"; label variable B1_v9 "Sub-Round"; label variable B1_v10 "Sub-Sample"; label variable B1_v11 "FOD Sub-Region"; label variable B1_v12 "Hamlet-Group/Sub-Block no."; label variable B1_v13 "Second Stage label variableatum"; label variable B1_v14 "Visit No."; label variable B1_v15 "HHS No."; label variable Level "Level"; label variable B9_v1 "Item Code"; label variable B9_v3 "No. In use"; label variable B9_v4 "No. of First-hand purchase"; label variable B9_v5 "Whether Hire-purchase?"; label variable B9_v6 "Value of First-hand purchase"; label variable B9_v7 "Cost of Raw material,service & repair"; label variable B9_v8 "No. of Second-hand purchase"; label variable B9_v9 "Value of Second-hand purchase"; label variable B9_v10 "Total Expenditure"; label variable NSS "NSS"; label variable NSC "NSC"; label variable MLT "MLT"; label variable hhwt "Household Weight"; label define state 1 "Jammu & Kashmir" 2 "Himachal Pradesh" 3 "Punjab" 4 "Chandigarh" 5 "Uttaranchal" 6 "Haryana" 7 "Delhi" 8 "Rajasthan" 9 "Uttar Pradesh" 10 "Bihar" 11 "Sikkim" 12 "Arunachal Pradesh" 13 "Nagaland" 14 "Manipur" 15 "Mizoram" 16 "Tripura" 17 "Meghalaya" 18 "Assam" 19 "West Bengal" 20 "Jharkhand" 21 "Orissa" 22 "Chattisgarh" 23 "Madhya Pradesh" 24 "Gujarat" 25 "Daman & Diu" 26 "Dadra & Nagar Haveli" 27 "Maharastra" 28 "Andhra Pradesh" 29 "Karnataka" 30 "Goa" 31 "Lakshadweep" 32 "Kerala" 33 "Tamil Nadu" 34 "Pondicherry" 35 "A & N Islands"; label define sample 1 "Central" 2 "State"; label define sector 1 "Rural" 2 "Urban"; label values state state; label values B1_v4 sample; label values B1_v5 sector; sort hhid B9_v1; save "$pathout\NSS59_Sch1_bk_9", replace;