The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Merging households with children information
Merging households with children information [message #4058] Tue, 24 March 2015 16:24 Go to previous message
Masa is currently offline  Masa
Messages: 1
Registered: March 2015
Location: United States
Member
Dear all,

I am working with all the DHS available for Latin America and Caribbean Countries. I want to merge the households with the children information. I am trying to get the teenage pregnancy and motherhood indicator and other indicators with different specifications.

I started with Peru 2012. My code is the following:

*Children
use "DHS\PEBR6IFL", clear
sort v001 v002 b16
egen id = concat(v001 v002 b16)
sort id
saveold "DHS\data_child", clear

*Households
use "DHS\PEPR6IFL.DTA", clear
sort hv001 hv002 hvidx
egen id = concat(hv001 hv002 hvidx)
merge m:m id using "DHS\data_child"


I would have expected that all the children match in their households, but I got ~12000 observations that are only in the using data (children database).

Checking the variable b16 (line of the children in household), I realized that the ~12000 observations not matched correspond to members that were not listed in the household.

I didn't delete any observation, instead I generated an id with the cluster and household number and matched those ~12000 in their households. Is it right?

On the other hand, I wanted to do the same with the database of Peru 2000, but all the values in b16 (line of the child in the household) are missing values. How could I generate the id in this case?

Thank you in advance for your help.

Best regards,
Masa









 
Read Message
Read Message
Previous Topic: Creating a panel dataset
Next Topic: How to set up sample weight for analysis
Goto Forum:
  


Current Time: Wed Nov 27 21:12:16 Coordinated Universal Time 2024