The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Constructing # of Sibling and HHmember rank Variables
Re: Constructing # of Sibling and HHmember rank Variables [message #9654 is a reply to message #9639] Fri, 29 April 2016 10:43 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3230
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The following Stata lines should do this, in the limited sense noted in comments at the end. You will have to change the paths.


use e:\DHS\DHS_data\BR_files\CIBR61FL.dta, clear
keep if b16>0 & b16<98
sort v001 v002 v003 b16
save e:\DHS\DHS_data\scratch\temp1.dta, replace

gen sibs_in_hh=1

collapse (sum) sibs_in_hh, by(v001 v002 v003)
replace sibs_in_hh=sibs_in_hh-1
tab sibs_in_hh,m

sort v001 v002 v003
merge v001 v002 v003 b16 using e:\DHS\DHS_data\scratch\temp1.dta

tab _merge
tab sibs_in_hh,m
drop _merge

* This file will include the number of siblings (children with the same mother) who are living in the same
* household, WITH THE MOTHER. Siblings who are not living with the mother will be much harder to identify.

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Pooled Multinomial Logistic Regression
Next Topic: analyzing blood pressure and blood glucose
Goto Forum:
  


Current Time: Thu Jan 30 23:36:43 Coordinated Universal Time 2025