***************************************************************************************** * Stata program for the conversion of data from the India NSS47 survey * from ASCII format to Stata format. * This program converts data from Schedule 3.1 and adds variables and value labels. * * Author: Cathrine Machingauta, World Bank Data Group (December 2012) ***************************************************************************************** clear set more off global pathout "Q:\India\IND_1991_NSS47-SCH3.1_v01_M\Data\Original\ascii\Sch3.1" global pathout "Q:\India\IND_1991_NSS47-SCH3.1_v01_M\Data\Stata" #delimit ; ***************************************************************; * SCHEDULE 3.1 - Level 1- Blocks 1&3 ; ***************************************************************; drop _all; infix str round 5-7 str FOD_subreg 8-11 str flot 12-16 str srl_No 17-21 str eligibility 22-24 str level 25-26 str srl_psn 27-29 str type_code 30 str S31B3_v11 32 str S31B3_v12 33 str S31B3_v13 34 str S31B3_v14 35 str S31B3_v15 36 str S31B3_v16 37 str S31B3_v17 38 str S31B3_v18 39 str S31B3_v19 40 str S31B3_v20 41 str S31B3_v21 42 str S31B3_v22 43 str S31B3_v23 44 str S31B3_v24 45 str S31B3_v25 46 str S31B3_v26 47 str S31B3_v27 48 str S31B3_v28 49 str S31B3_v29 50 str S31B3_v30 51 str S31B3_v31 52 str S31B3_v32 53 str S31B3_v33 54 str S31B3_v34 55 str S31B3_v35 56 str S31B3_v36 57 str S31B3_v37 58 str S31B3_v38 59 str S31B3_v39 60 str S31B3_v40 61 str S31B3_v41 62 str S31B3_v42 63 str S31B3_v43 64 str S31B3_v44 65 str S31B3_v45 66 str sample 117 str sector 118 str statereg 119-121 str state 119-120 str stratum 122-123 str subsample 124 str subround 125 str update_code 126 using "$pathin\D126R.DAT"; keep if level=="01" ; destring,replace; la var round "Round-Schedule"; la var FOD_subreg "FOD sub-region"; la var flot "Flot no."; la var srl_No "Vill. block s.no."; la var eligibility "Whether eligible"; la var level "Level no."; la var srl_psn "Item/person srl.no"; la var type_code "Type code"; la var S31B3_v11 "Distance of Integrated child development service centre from centre of sample village"; la var S31B3_v12 "Distance of Pre-primary school from centre of sample village"; la var S31B3_v13 "Distance of Primary school from centre of sample village"; la var S31B3_v14 "Distance of Middle school from centre of sample village"; la var S31B3_v15 "Distance of Secondary school from centre of sample village"; la var S31B3_v16 "Distance of Higher secondary school/junior college from centre of sample village"; la var S31B3_v17 "Distance of College with degree course from centre of sample village"; la var S31B3_v18 "Distance of Industrial training instutute from centre of sample village"; la var S31B3_v19 "Distance of Other technical institutions from centre of sample village"; la var S31B3_v20 "Distance of Sanskrit patiasala from centre of sample village"; la var S31B3_v21 "Distance of Maktab/madrsa from centre of sample village"; la var S31B3_v22 "Distance of Non-formal education centre from centre of sample village "; la var S31B3_v23 "Distance of Adult education centre from centre of sample village"; la var S31B3_v24 "Distance of Dance/music institution from centre of sample village"; la var S31B3_v25 "Distance of Drawing/painting institution from centre of sample village"; la var S31B3_v26 "Distance of Gana shiksha nilayam from centre of sample village"; la var S31B3_v27 "Distance of Public library/reading room from centre of sample village"; la var S31B3_v28 "Distance of Community radio centre from centre of sample village"; la var S31B3_v29 "Distance of Community T.V.centre from centre of sample village"; la var S31B3_v30 "Distance of Community hall from centre of sample village"; la var S31B3_v31 "Distance of Cinema hall from centre of sample village"; la var S31B3_v32 "Distance of Religious centre from centre of sample village"; la var S31B3_v33 "Distance of Sports club from centre of sample village"; la var S31B3_v34 "Distance of Recreational club from centre of sample village"; la var S31B3_v35 "Distance of Youth club from centre of sample village"; la var S31B3_v36 "Distance of non formal education centre Mahila mandal from centre of sample village"; la var S31B3_v37 "Distance of Philanthropic institution from centre of sample village"; la var S31B3_v38 "Distance of Professional cultural unit from centre of sample village"; la var S31B3_v39 "Distance of Integrated educational centre for disabled persons from centre of sample village"; la var S31B3_v40 "Distance of Special school for the blind from centre of sample village"; la var S31B3_v41 "Distance of Special school for the deaf from centre of sample village"; la var S31B3_v42 "Distance of Special school for the mentally retarded from centre of sample village"; la var S31B3_v43 "Distance of Vocational training centre from centre of sample village"; la var S31B3_v44 "Distance of Institution./orgn. For rehabilitation of disabled persons from centre of sample village"; la var S31B3_v45 "Whether mobile rehabilitation services available to the village (Yes=1,no=2)"; la var sample "ID. Central/state sample"; la var sector "Sector"; la var statereg "State-region"; la var state "State"; la var stratum "Stratum"; la var subsample "Sub-sample"; la var subround "Sub-round"; la var update_code "Update code"; la de state 2 "Andhra Pradesh" 3 "Assam" 4 "Bihar" 5 "Gujarat" 6 "Haryana" 7 "Himachal Pradesh" 8 "Jammu & Kashmir" 9 "Karnataka" 10"Kerala" 11"Madhya Pradesh" 12"Maharashtra" 13"Manipur" 14"Meghalaya" 15"Nagaland" 16"Orissa" 17"Punjab" 18"Rajasthan" 19"Sikkim" 20"Tamil Nadu" 21"Tripura" 22"Uttar Pradesh" 23"West Bengal" 24"A & N Islands" 25"Arunachal Pradesh" 26"Chandigarh" 27"Dadra & Nagar Haveli" 28"Delhi" 29"Goa" 30"Lakshdweep" 31"Mizoram" 32"Pondicherry" 33"Daman & Diu"; la val state state; la de sector 1 "Rural" 2 "Urban"; la val sector sector; la def sample 1"Central" 2 "State"; la val sample sample; foreach var of varlist S31B3_v11-S31B3_v44 {; la def `var' 1"Within village" 2"Outside village: kess than 2km" 3"2 to 5km" 4"5 to 10km" 5"10km or more"; la val `var' `var'; }; la def S31B3_v45 1"Yes" 2"No"; la val S31B3_v45 S31B3_v45; order srl_No state; sort srl_No state; compress ; tempfile bk1_3; save `bk1_3',replace; ***************************************************************; * Multipliers ; ***************************************************************; drop _all; infix str state 6-7 str srl_No 13-17 str MLT_subsample 269-278 str MLT_combined 279-288 using "$pathin\M300R.DAT"; destring, replace; la var state "state"; la var srl_No "Srl_No"; la var MLT_subsample "MLT_subsample"; la var MLT_combined "MLT_combined"; la val state state; foreach x in MLT_subsample MLT_combined{; replace `x' =`x'/10; }; order srl_No state; sort srl_No state; compress ; tempfile MLT; save `MLT',replace; use `bk1_3',clear; merge 1:1 srl_No using `MLT'; keep if _merge==3; drop _merge; sort srl_No state; saveold "$pathout\NSS47_Sch31_bk1_3.dta", replace ;