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 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 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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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 2 01:38:18 Coordinated Universal Time 2024