The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » District-level sex ratio and district-level age distribution
Re: District-level sex ratio and district-level age distribution [message #23974 is a reply to message #23960] Sun, 23 January 2022 16:07 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3096
Registered: February 2013
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

This would be done with the PR file. The following lines use the "collapse" command to give you the sex distribution and the age distribution (in 5-year intervals). There is also a file that gives the age-sex distribution. You need to specify whether you want the de facto or de jure population. Even the collapsed files are large!

* You need to specify a workspace
cd e:\DHS\DHS_data\scratch

use hv005 hv102-hv105 shdistri using "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\IAPR74FL.DTA" , clear

gen wt=hv005/1000000

* If you want the de jure population
keep if hv102==1

* If, instead, you want the de facto population
* keep if hv103==1

* drop if age (hv105) is missing (.02 of 1% of cases). hv105 is 95 for age 95+
drop if hv105>95

* age5 gives standard age intervals for age 0-4, 5-9, etc
gen age5=1+ int(hv105/5)

collapse (sum) wt, by(hv104 age5 shdistri)
save IAtemp_age_sex_district.dta, replace

use IAtemp_age_sex_district.dta, clear
collapse (sum) wt, by(sex district)

* this file gives the weighted numbers of males and females in each district in the NFHS-4
save IAtemp_sex_district.dta, replace

use IAtemp_age_sex_district.dta, clear
collapse (sum) wt, by(age district)

* this file gives the weighted numbers of males and females in each five-year age group in the NFHS-4
save IAtemp_age_district.dta, replace


 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Birth Size
Next Topic: Estimating PNC
Goto Forum:
  


Current Time: Sun Jun 30 08:49:50 Coordinated Universal Time 2024