The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Creating dummy variable for younger sisters
Creating dummy variable for younger sisters [message #16157] Mon, 12 November 2018 15:22 Go to next message
mkennedy is currently offline  mkennedy
Messages: 2
Registered: November 2018
Member
I am currently studying the effect of early marriage on education with Nigeria's 2013 DHS data - specifically the individual recode (female respondents). I am specifically using birth order as an instrumental variable and am having difficulty creating variables given that the dataset I'm using doesn't have clearly defined variables for number of older sisters, number of younger sisters, etc. MM1 (_01,_02,...) includes the sex of all siblings but does not indicate the order of birth they are in. Can someone please guide me on this?
Re: Creating dummy variable for younger sisters [message #16184 is a reply to message #16157] Mon, 19 November 2018 08:52 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The imputed cmc of birth is given by mm4. You have the cmc of the respondent's birth as v011. In Stata, you can get the numbers of older and younger sisters and brothers with lines such as the following. If you are not using Stata, you will have to convert. I include a check to make sure that the total of these four numbers is equal to the total number of siblings. I arbitrarily count a twin with the older siblings (sisters or brothers).


* Construct copies of mmidx
*   older_sister=mmidx if the sibling is female and older than the respondent
* younger_sister=mmidx if the sibling is female and younger than the respondent
* similarly for brothers

OPEN THE IR FILE

rename mm*_0* mm*_*
local li=1
quietly while `li'<=20 {
gen   older_sister_`li'=mmidx_`li'
gen younger_sister_`li'=mmidx_`li'

replace   older_sister_`li'=. if mm1_`li'==1 | mm4_`li'<v011
replace younger_sister_`li'=. if mm1_`li'==1 | mm4_`li'>=v011

gen   older_brother_`li'=mmidx_`li'
gen younger_brother_`li'=mmidx_`li'

replace   older_brother_`li'=. if mm1_`li'==2 | mm4_`li'<v011
replace younger_brother_`li'=. if mm1_`li'==2 | mm4_`li'>=v011

local li=`li'+1
}

egen         n_siblings=rownonmiss(mmidx*)
egen    n_older_sisters=rownonmiss(older_sister*)
egen  n_younger_sisters=rownonmiss(younger_sister*)
egen   n_older_brothers=rownonmiss(older_brother*)
egen n_younger_brothers=rownonmiss(younger_brother*)
gen n_check=n_older_sisters+n_younger_sisters+n_older_brothers+n_younger_brothers

correlate n_siblings n_check
Previous Topic: computing Concentration curves and Indices using stata
Next Topic: 2015-16 individual Recode dataset for India
Goto Forum:
  


Current Time: Fri Nov 29 05:37:37 Coordinated Universal Time 2024