Re: District-level sex ratio and district-level age distribution [message #23988 is a reply to message #23986] |
Tue, 25 January 2022 07:42 ![Go to previous message Go to previous message](/theme/default/images/up.png) |
Bridgette-DHS
Messages: 3152 Registered: February 2013
|
Senior Member |
|
|
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:
I just looked again and I see a couple of typos. I didn't actually test the program because the file is so large.
In these lines:
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)
"by(sex district)" should be replace by "by(hv104 shdistri)" and "by(age district)" should be replaced by "by(age5 shdistri)".
I really think it is very clear what each step of the program does. Stata code is very intuitive. There are no complicated commands or options. I'll just clarify one command. "collapse (sum) wt, by(hv104 shdistri)" means that the file is reduced by adding up the values of "wt" within each combination of sex and district. There will be one line for each combination and it will include the total weighted number of cases.
|
|
|