The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Sex ratio at birth using IR file , India, NFHS-5
Re: Sex ratio at birth using IR file , India, NFHS-5 [message #26081 is a reply to message #26078] Mon, 06 February 2023 09:00 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:

I believe you are referring to the sex ratio at birth. This can be calculated with logit regression using the KR file (births in the past 5 years). If you want the sex ratio for surviving children under 5 you just restrict the KR file to children with b5=1. To get the sex ratio for other populations, use the PR file. You do not use the IR file for this purpose, unless you want to reshape the birth histories, and they are already reshaped into the KR and BR files.

The sex ratio can be defined in different ways. In biology it is the proportion of individuals who are female. In demography it is usually the number of males per 100 females. You say you want the number of females per 1000 males. The following Stata program calculates males per 100 females and females per 1000 males and saves the results as scalars. If you want to loop over subpopulations and save the results in a separate file, you can adapt the Stata program we posted on Feb. 3 for the neonatal mortality rate (NMR). In the labels, P, L, and U are the point estimate, the lower end of the 95% confidence interval, and the upper end of the 95% confidence interval, respectively.

* Calculate the sex ratio at birth for births in the past 5 years using the KR file

use "...IAKR7DFL.DTA" , clear

egen cluster_ID=group(v024 v001)
svyset cluster_ID [pweight=v005], strata(v023) singleunit(centered)

tab b4 [iweight=v005/1000000]

* Sex ratio defined as males per 100 females
gen     m_per_100f=0
replace m_per_100f=1 if b4==1

svy: logit m_per_100f
matrix T=r(table)
matrix list T

scalar P_m_per_100f=100*exp(T[1,1])
scalar L_m_per_100f=100*exp(T[5,1])
scalar U_m_per_100f=100*exp(T[6,1])

* Sex ratio defined as females per 1000 males
gen     f_per_1000m=0
replace f_per_1000m=1 if b4==2

svy: logit f_per_1000m
matrix T=r(table)
matrix list T

scalar P_f_per_1000m=1000*exp(T[1,1])
scalar L_f_per_1000m=1000*exp(T[5,1])
scalar U_f_per_1000m=1000*exp(T[6,1])

scalar list


Results:

. scalar list
U_f_per_1000m =  935.04401
L_f_per_1000m =  914.19561
P_f_per_1000m =  924.56104
U_m_per_100f =  109.38578
L_m_per_100f =  106.94684
P_m_per_100f =  108.15943


 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Apply Weights to household members (PR) files
Next Topic: Multilevel model for SPA data
Goto Forum:
  


Current Time: Sat Nov 23 15:13:19 Coordinated Universal Time 2024