The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » All-women factor in trend analysis (All-women factor in trend analysis)
Re: All-women factor in trend analysis [message #26714 is a reply to message #26709] Fri, 21 April 2023 09:23 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 staff member, Tom Pullum:

I just looked, and my version of the constructed all-women file does include valid values of v005 for all women.

If nmw_file.dta includes v005 (it does for me and you say it does for you) then you need to check the following lines in the program:
quietly append using nmw_file.dta

* Check after the append to confirm the addition of many cases with NA
tab bidx_01,m

* re-calibrate v005 so the ratio of mean weights in this combined file is the same as in the PR file
* do not change the IR (emw) weights; instead, multiply the nmw weights (hv005) from the PR file by a factor

summarize v005 if nmw==1
scalar mean_wt_nmw=r(mean)

summarize v005 if nmw==0
scalar mean_wt_emw=r(mean)

* the ratio of mean weights, nmw to emw, in the combined file, is mean_wt_nmw/mean_wt_dmw
* need to multiply the nmw=1 weights by a factor so the ratio matches the ratio in the PR file

replace v005=v005*(mean_wt_emw/mean_wt_nmw)*mean_wt_ratio_nmw_to_emw if nmw==1

These lines work ok for me, but perhaps you are getting a warning of some kind or something else is happening with a default. I suggest that you insert "summarize v005" at several points, especially right after the "append" and see whether the number of cases "Obs" in the output stays constant and at the correct value from the beginning to the end of this section of the program. Hope you can figure it out.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Response rate and weights
Next Topic: Number of obs and population size not the same
Goto Forum:
  


Current Time: Mon Nov 25 19:48:18 Coordinated Universal Time 2024