The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » respondents not visiting health facility
Re: respondents not visiting health facility [message #25472 is a reply to message #25468] Tue, 25 October 2022 12:42 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3043
Registered: February 2013
Senior Member
Following is a response from DHS staff member, Tom Pullum:

There are probably different ways to interpret what you want. The following Stata code estimates this: Out of all households with at least one "yes" or "no" response, what is the percentage that had at least one "yes". I don't use R but you should be able to translate this from Stata to R.


use "...IAIR7DFL.DTA" ,clear
gen reg=v024
gen cluster=v001
gen hh=v002
gen line=v003

gen s361_yes=1 if s361==1
gen s361_no =1 if s361==0

gen s368_yes=1 if s368==1
gen s368_no =1 if s368==0

* Collapse to get the numbers of yes and no responses within households
collapse (sum) s361_* s368_* (first) v005, by(reg cluster hh)

* The units of analysis are households with at least one woman who has a response to s361
tab s361_yes s361_no [iweight=v005/1000000] 
gen     s361_yes_1plus=0 if s361_yes+s361_no>0
replace s361_yes_1plus=1 if s361_yes>1
tab s361_yes_1plus [iweight=v005/1000000]

* The units of analysis are households with at least one woman who has a response to s368
tab s368_yes s368_no [iweight=v005/1000000] 
gen     s368_yes_1plus=0 if s368_yes+s368_no>0
replace s368_yes_1plus=1 if s368_yes>1
tab s368_yes_1plus [iweight=v005/1000000]



use "...IAMR7DFL.DTA", clear 
gen reg=mv024
gen cluster=mv001
gen hh=mv002
gen line=mv003

gen sm320_yes=1 if sm320==1
gen sm320_no =1 if sm320==0

* Collapse to get the numbers of yes and no responses within households
collapse (sum) sm320_* (first) mv005, by(reg cluster hh)

* The units of analysis are households with at least one man who has a response to sm320
tab sm320_yes sm320_no [iweight=mv005/1000000] 
gen     sm320_yes_1plus=0 if sm320_yes+sm320_no>0
replace sm320_yes_1plus=1 if sm320_yes>1
tab sm320_yes_1plus [iweight=mv005/1000000]
 
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 log-binomial regression
Next Topic: Merging PR and KR file NFHS
Goto Forum:
  


Current Time: Fri Apr 26 17:01:04 Coordinated Universal Time 2024