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 #25480 is a reply to message #25479] Wed, 26 October 2022 11:46 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 DHS staff member, Tom Pullum:

I think the problem is that v024 (or other covariates) must be included in the "collapse" command, after "(first)". Otherwise the covariate is lost. The following should do what you want.

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 v024, by(reg cluster hh)

* Must re-attach the values label after the collapse
label values v024 V024 

* 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 v024 s361_yes_1plus [iweight=v005/1000000], row



* 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 v024 s368_yes_1plus [iweight=v005/1000000], row



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 mv024, by(reg cluster hh)

* Must re-attach the values label after the collapse
label values mv024 MV024 

* 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 mv024 sm320_yes_1plus [iweight=mv005/1000000], row
 
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: Wed Nov 27 10:23:50 Coordinated Universal Time 2024