The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » All women factor in stata
Re: All women factor in stata [message #9207 is a reply to message #9178] Tue, 23 February 2016 15:11
 Bridgette-DHS Messages: 2949Registered: February 2013 Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The all-women factors are a major headache. Fortunately only a few surveys are limited to ever-married women.

The weight for the numerators is not affected, but the weight for the denominators will be multiplied by awfactt/100. The "t" after "awfact" tells you that that weight is for the total. If you want weight separately by urban-rural place of residence, or region, or one or two other covariates, you look for another letter (instead of "t"). What kind of analysis of first births do you want to do?

I will insert below a trick to get the mean of v201 using awfactt with Poisson regression and an offset. It may help.

* Strategy to implement awfactt for a mean

* Illustrate with Egypt

* I want to get:
* the unweighted mean ceb for emw
* the weighted mean ceb for emw
* the weighted mean ceb for all women (using awfactt)

set more off

cd e:\DHS\DHS_data\IR_files

use EGIR61FL.DTA, clear

keep v005 awfactt v201

rename v201 ceb

* the unweighted mean ceb for emw
summarize ceb

* the weighted mean ceb for emw
summarize ceb [iweight=v005/1000000]

* brute force
gen numerator=ceb*(v005/1000000)
gen denominator1=v005/1000000
gen denominator2=(v005/1000000)*(awfactt/100)

save temp.dta, replace

collapse (sum) numerator denominator*

gen mean1=numerator/denominator1
gen mean2=numerator/denominator2

* mean1 and mean2 are the weighted mean ceb for emw and all women, respectively
list, table clean

use temp.dta, clear

* Now get these three means using poisson regression

* this will match with the unweighted mean ceb for emw
poisson ceb, irr

* this will match with the weighted mean ceb for emw
poisson ceb [pweight=v005], irr

* this will match with the weighted mean ceb for all women
gen off=log(awfactt/100)
poisson ceb [pweight=v005], offset(off) irr

 All women factor in stata By: charvey91 on Fri, 19 February 2016 06:59 Re: All women factor in stata By: Bridgette-DHS on Tue, 23 February 2016 15:11 Re: All women factor in stata By: voddo on Fri, 22 April 2016 14:20 Re: All women factor in stata By: Bridgette-DHS on Mon, 25 April 2016 08:41 Re: All women factor in stata By: Nahid on Thu, 12 November 2020 05:52 Re: All women factor in stata By: Bridgette-DHS on Thu, 12 November 2020 08:06
 Previous Topic: Using R to weight data for domestic violence Next Topic: Sampling Weights for HbA1c SA DHS 2017
Goto Forum:

Current Time: Mon Dec 11 13:58:22 Coordinated Universal Time 2023