The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » Why I am getting different total observations when using iweight for tabulating a variable
Re: Why I am getting different total observations when using iweight for tabulating a variable [message #26128 is a reply to message #26124] Fri, 10 February 2023 07:58 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:

Very sorry--somehow the line "scalar sfactor=B[1,1]/B[1,2]" was dropped. Please see below. Hope this will do what you want.

gen unwtd=1000000 
total unwtd hv005 
matrix B=e(b) 
matrix list B 
scalar sfactor=B[1,1]/B[1,2]
scalar list sfactor 
gen hv005_PR=round(sfactor*hv005)

 
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: Multilevel model with region random effects
Next Topic: Response rate and weights
Goto Forum:
  


Current Time: Sun Dec 1 15:09:24 Coordinated Universal Time 2024