The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Fertility » Gender of the first born child
Gender of the first born child [message #21974] Tue, 12 January 2021 12:06 Go to next message
Sufian is currently offline  Sufian
Messages: 2
Registered: January 2021
Member
Hi!

I want to construct a categorical variable for the gender of first born child using Pdhs in order to identify the effect of gender of first born on the fertility of women. I would highly appreciate any help in this matter. I used bord_01 to generate a dummy that is one if the first born is a son but it appears I making a mistake and the results are rather weird. My guess is the way I construct the variable is wrong.
I would appreciate any help.

Best,
S.
Re: Gender of the first born child [message #21982 is a reply to message #21974] Wed, 13 January 2021 08:36 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 2267
Registered: February 2013
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

The following lines will do what you want. You can run this on any IR file. I assign code "0" to women who have not had a first birth but of course that's optional.

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\ALIR71FL.DTA" , clear

rename b*_0* b*_*

gen sex_of_first_child=.

local li=1
while `li'<=20 {
replace sex_of_first_child=b4_`li' if bord_`li'==1
local li=`li'+1
}

replace sex_of_first_child=0 if sex_of_first_child==.

label define first_child 0 "No children" 1 "Boy" 2 "Girl"
label values sex_of_first_child first_child
tab sex_of_first_child
Re: Gender of the first born child [message #21983 is a reply to message #21982] Wed, 13 January 2021 08:52 Go to previous message
Sufian is currently offline  Sufian
Messages: 2
Registered: January 2021
Member
Dear Tom Pullum!

Thank you so much for the help, you are wonderful.

Kind Regards and a happy new year!

S.
Previous Topic: STATE LEVEL DATA
Next Topic: Please help! DHS Malawi youth-specific
Goto Forum:
  


Current Time: Sun May 9 01:27:17 Coordinated Universal Time 2021