The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Replicating Step 7 and Level-2 Weight from Report 27
Re: Replicating Step 7 and Level-2 Weight from Report 27 [message #27279 is a reply to message #27276] Wed, 12 July 2023 17:20 Go to previous messageGo to previous message
Yawo is currently offline  Yawo
Messages: 45
Registered: February 2019
Member
Thanks for your response. I understand the procedure, so just to be clear, I have two related questions:

Q1: Given that I am combining the data for both men and women, are the following codes ok now?

**************** STAGE A ********************
* 7: Prepare the adjusted final/individual adjusted weight for men and women: dividing population of women or men by the appropriate number interviewed; de-normalize the final weight */
gen newwt =.
replace newwt =(v005/1000000)*(4764000/10060) if sex==1
replace newwt =(v005/1000000)*(5538000/5135) if sex==2
label variable newwt "Population adjusted sample weight"

************ STAGE B: APPROXIMATE LEVEL-1 AND LEVEL-2 WEIGHTS ************
/*Step 1: De-normalize the final weight, using approximated normalization factor. */
gen d_HH = newwt * (M/m_c)

/* Step 2: Approximate the level-2 weight (get f variation factor; set alpha based equal split method (α=0.5), then generate wt 2) */
gen f = d_HH / ((A_h/a_c_h) * (M_h/S_h))
scalar alpha = 0.5 
gen wt2 = (A_h/a_c_h)*(f^alpha) 

/* Step 2B - OPTIONAL: Generate a revised level-2 weight by replacing it with its geometric mean [if needed to get resolve the "weights in variable wt2 not constant within groups defined by: v001" error - based on advice by Tom here in [message #21803]:https://userforum.dhsprogram.com/index.php?t=msg& ;amp ;amp ;amp;th=9098&goto=21803&#msg_21803
gen ln_wt2=log(wt2)
egen mean_wt2=mean(ln_wt2), by(v001)
gen rev_wt2=exp(mean_wt2)
drop ln_wt2

/* Step 3: Approximate the level-1 weight */
gen wt1 = d_HH/wt2

Q2: If rev_wt2 is used, then should we adjust the formula for wt1 as well: gen rev_wt1 = d_HH/rev_wt? By the same token, should we also change to the rev_wt2 in the loop (i.e, gen wt1_`i' = d_HH/wt2_`i')?


With much appreciation for your assistance.

Cy

[Updated on: Wed, 12 July 2023 22:51]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Estimation of level-weights using the Couple-Recode (CR) data from the DHS dataset
Next Topic: Inconsistencies in v022, v024 and Appendix A Tables
Goto Forum:
  


Current Time: Sat Aug 3 04:14:29 Coordinated Universal Time 2024