/* This program reshape individual level, assets ownership and fuel expenditure by type data from "IAP-DistrictSurveyData.dta" */ *reshape assets ownership data (question 8 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q8_1_1- q8_29_2 replace q8_29_1="3" if q8_29_1=="1+1+1" forvalues i=1(1)28 { gen q8_`i'_0="`i'" } forvalues i=1(1)29 { forvalues j=0(1)2{ ren q8_`i'_`j' q8`j'_`i' } } replace q80_2="APARTMENT" if q81_2=="APARTMENT" replace q81_2="" if q81_2=="APARTMENT" destring q81_2 q81_29, replace reshape long q80_ q81_ q82_ ,i(id_code svyarea location timestart) drop _j drop if q80_=="" ren q80_ q8_0 ren q81_ q8_1 ren q82_ q8_2 la var q8_0 "Asset description" la var q8_1 "Asset amount" la var q8_2 "Present market value in Taka" drop if q8_1>=. & q8_2 >=. sort id_code q8_0 save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ8Data.dta", replace *reshape demographic data (question 11 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q11_1_0- q11_17_13_4 forvalues i=1(1)17 { forvalues j=0(1)10{ ren q11_`i'_`j' q11`j'_`i' } } forvalues i=1(1)17 { forvalues j=1(1)3{ ren q11_`i'_11_`j' q1111`j'_`i' } } forvalues i=1(1)17 { forvalues j=1(1)4{ ren q11_`i'_12_`j' q1112`j'_`i' ren q11_`i'_13_`j' q1113`j'_`i' } } label drop _all replace q117_3="0.67" if q117_3=="8 MONTHS" destring q117_3, replace tostring q119_*, replace reshape long q110_ q111_ q112_ q113_ q114_ q115_ q116_ q117_ q118_ q119_ q1110_ /// q11111_ q11112_ q11113_ q11121_ q11122_ q11123_ q11124_ q11131_ q11132_ q11133_ q11134_ ,i(id_code svyarea location timestart) drop _j drop if q110_ >=. ren q110_ q11_0 ren q111_ q11_1 ren q112_ q11_2 ren q113_ q11_3 ren q114_ q11_4 ren q115_ q11_5 ren q116_ q11_6 ren q117_ q11_7 ren q118_ q11_8 ren q119_ q11_9 ren q1110_ q11_10 ren q11111_ q11_11_1 ren q11112_ q11_11_2 ren q11113_ q11_11_3 ren q11121_ q11_12_1 ren q11122_ q11_12_2 ren q11123_ q11_12_3 ren q11124_ q11_12_4 ren q11131_ q11_13_1 ren q11132_ q11_13_2 ren q11133_ q11_13_3 ren q11134_ q11_13_4 la var q11_0 "Person ID" la var q11_1 "Name of the Person" la var q11_2 "Relation to the interviewee" la var q11_3 "Gender" la val q11_3 gender la var q11_4 "Age (in years)" la var q11_5 "Can individual read or write" la def readwrt 0 "Can’t read or write" 1 "Only read but not write" 2 "Read & Write" la val q11_5 readwrt la var q11_6 "Highest education level" la def edulevel 0 "No schooling" 1 "Less than or equal to five year of schooling" 2 "Six to ten years of schooling" /// 3 "Eleven to twelve years of schooling" 4 "More than twelve years of schooling" la val q11_6 edulevel la var q11_7 "Number of years residing in the house" la var q11_8 "Primary occupation" *la def occup 1 "House wife" 2 "Service holder" 3 "Farmer" 4 "Day laborer" 5 "SELF employed" 6 "Unemployed" /// * 7 "Student" 8 "Disabled" 9 "Beggar" 10 "Retired" 11 "Religious work" 12 "Servant" /// * 13 "Teaching" 14 "Trainee" 15 "Work learning" *la val q11_8 occup la var q11_9 "Secondary occupation" *destring q11_9, replace *la val q11_9 occup la var q11_10 "Any major disease in the last two weeks" la def yesno 0 "No" 1 "Yes" la val q11_10 yesno la var q11_11_1 "Number of work days lost due to illness in the last two weeks" la var q11_11_2 "Number of non-work days lost due to illness in the last two weeks" la var q11_11_3 "Number of restricted activity days lost due to illness in the last two weeks" la var q11_12_1 "Smoker" la def smoker 0 "No" 1 "Yes" 2 "Ex-smoker" la val q11_12_1 smoker la var q11_12_2 "If yes or ex-smoker then what kind" la def smktype 1 "Pipe or hukka" 2 "Cigarette without filter" 3 "Cigarette with filter" la val q11_12_2 smktype la var q11_12_3 "Number of sticks per day" la var q11_12_4 "Number of grams per day" la var q11_13_1 "Time activity pattern, Indoor, In kitchen (in hours)" la var q11_13_2 "Time activity pattern, Indoor, In living area (in hours)" la var q11_13_3 "Time activity pattern, Indoor, Other room (in hours)" la var q11_13_4 "Time activity pattern, Outdoor (in hours)" sort id_code q11_0 save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ11Data.dta", replace *reshape fuel expenditure data (question 66 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q66_1_1- q66_17_7 ren q66_17_1_0 q66_17_0 ren q66_17_3_1 q6631_17 ren q66_17_3_2 q6632_17 forvalues i=1(1)16 { gen q66_`i'_0="`i'" gen q6631_`i'="" gen q6632_`i'=. } forvalues i=1(1)17 { forvalues j=0(1)7{ ren q66_`i'_`j' q66`j'_`i' } } replace q662_1=0.3 if q661_1=="KG" replace q663_1="KG" if q661_1=="KG" replace q661_1="3" if q661_1=="KG" replace q661_6="" if q661_6=="S" replace q661_16="45" if q661_16=="45 HOUR" replace q662_3="" if q662_3=="NOT AVAILABLE" replace q662_10="" if q662_10=="NOT AVAILABLE" destring q661_1 q661_6 q661_16 q662_3 q662_10, replace tostring q666_5 q666_8 q666_9 q666_11 q666_13 q666_15 q666_16 q666_17, replace reshape long q660_ q661_ q662_ q663_ q6631_ q6632_ q664_ q665_ q666_ q667_ ,i(id_code svyarea location timestart) drop _j drop if q660_=="" ren q660_ q66_0 ren q661_ q66_1 ren q662_ q66_2 ren q663_ q66_3 ren q6631_ q66_3_1 ren q6632_ q66_3_2 ren q664_ q66_4 ren q665_ q66_5 ren q666_ q66_6 replace q66_6="" if q66_6=="." ren q667_ q66_7 la var q66_0 "Fuel Name/Type" la var q66_1 "Total expenditure in taka" la var q66_2 "Market value when not purchased in taka" la var q66_3 "Unit of quantity" la var q66_3_1 "Unit of quantity (in bunch)" la var q66_3_2 "Unit of quantity (in stick)" la var q66_4 "Price per unit" la var q66_5 "Collection - time (in hours)" la var q66_6 "Collection - who collect, Name ID" la var q66_7 "Collection - expenditure for collection (in taka)" drop if q66_1 >=. & q66_2 >=. & q66_3 =="" & q66_3_1=="" & q66_3_2 >=. & q66_4 >=. & q66_5 >=. & q66_6=="" & q66_7 >=. sort id_code q66_0 save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ66Data.dta", replace *reshape cooks data (question 68 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q68_1_1- q68_5_4 tostring q68_1_1 q68_2_1 q68_3_1 q68_4_1 q68_5_1, replace forvalues i=1(1)5 { forvalues j=1(1)4{ ren q68_`i'_`j' q68`j'_`i' } } reshape long q681_ q682_ q683_ q684_,i(id_code svyarea location timestart) drop _j ren q681_ q68_1 ren q682_ q68_2 ren q683_ q68_3 ren q684_ q68_4 la var q68_1 "ID of cook" la var q68_2 "Age at which started to cook? (in years)" la var q68_3 "How many days does the person cook in a month?" la var q68_4 "On a typical day, how often does the person cook (in hours)" replace q68_1="" if q68_1=="." drop if q68_1=="" & q68_2>=. & q68_3>=. & q68_4>=. sort id_code q68_1 save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ68Data.dta", replace *reshape cooking session data (question 69 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q69_1_1- q69_10_6 tostring q69_*_3, replace replace q69_3_3="" if q69_3_3=="." replace q69_4_3="" if q69_4_3=="." replace q69_5_3="" if q69_5_3=="." replace q69_6_3="" if q69_6_3=="." replace q69_7_3="" if q69_7_3=="." replace q69_8_3="" if q69_8_3=="." replace q69_9_3="" if q69_9_3=="." replace q69_10_3="" if q69_10_3=="." forvalues i=1(1)10 { forvalues j=1(1)6{ ren q69_`i'_`j' q69`j'_`i' } } reshape long q691_ q692_ q693_ q694_ q695_ q696_,i(id_code svyarea location timestart) ren _j ck_sesion ren q691_ q69_1 ren q692_ q69_2 ren q693_ q69_3 ren q694_ q69_4 ren q695_ q69_5 ren q696_ q69_6 la var ck_sesion "Cooking session" la var q69_1 "How long was it? (in minutes)" la var q69_2 "Number of people cooked for?" la var q69_3 "Who cooked? Name ID" la var q69_4 "Number of helpers? (excluding children)" la var q69_5 "How many children present?" la var q69_6 "How long was the fire on after cooking ? (In minutes)" drop if q69_1>=. & q69_2>=. & q69_3=="" & q69_4>=. & q69_5>=. &q69_6>=. sort id_code ck_sesion save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ69Data.dta", replace *reshape condition of breathing of HH members data (question 72 in District Survey Questionnaire) use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear keep id_code svyarea location timestart q72_1_1- q72_18_2 forvalues i=1(1)18 { forvalues j=1(1)2{ ren q72_`i'_`j' q72`j'_`i' } } reshape long q721_ q722_ ,i(id_code svyarea location timestart) drop _j ren q721_ q72_1 ren q722_ q72_2 la var q72_1 "Name ID" la var q72_2 "Code for breathing" drop if q72_1>=. & q72_2>=. sort id_code q72_1 save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyQ72Data.dta", replace *extracting household level (basic) data use "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyData.dta", clear drop q8_1_1- q8_29_2 q11_1_0- q11_17_13_4 q66_1_1- q66_17_7 q68_1_1- q68_5_4 /// q69_1_1- q69_10_6 q70_1_1- q70_8_7 q71_1_1- q71_7_3 q72_1_1- q72_18_2 sort id_code save "C:\BGD_2004_IAP\Data\IAP-DistrictSurveyHHData.dta", replace