The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » General Data Questions » Education variable (PR file) (Education of head of household)
Re: Education variable (PR file) [message #18040 is a reply to message #18004] Fri, 23 August 2019 14:27 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3038
Registered: February 2013
Senior Member

Following is a response from DHS Research and Data Analysis Director, Tom Pullum:

I think there is a way to do this in Stata with one of the "egen" commands, but the following is very fast. You will have to change the paths. Let us know if this doesn't work!

* Open and save PR file
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\TZPR7AFL.DTA" , clear
save e:\DHS\DHS_data\scratch\TZPR_temp1.dta, replace

* Construct and save a file reduced to the household head
keep if hv101==1
keep hhid hv106
rename hv106 hv106_head
sort hhid
save e:\DHS\DHS_data\scratch\TZPR_temp2.dta, replace

* Re-open the PR file and merge with the head's information
use e:\DHS\DHS_data\scratch\TZPR_temp1.dta, clear
sort hhid hvidx
merge hhid using e:\DHS\DHS_data\scratch\TZPR_temp2.dta

drop _merge

* Check 
list hhid hvidx hv106 hv106_head if _n<=50, table clean
 
Read Message
Read Message
Previous Topic: Education variable inconsistent
Next Topic: Sampling weights harmonization between DHS and MICS
Goto Forum:
  


Current Time: Wed Apr 24 05:08:42 Coordinated Universal Time 2024