The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » HIV » The Gambia DHS
Re: The Gambia DHS [message #14737 is a reply to message #14730] Wed, 02 May 2018 20:51 Go to previous messageGo to previous message
sngacksowe@yahoo.com is currently offline  sngacksowe@yahoo.com
Messages: 4
Registered: April 2018
Location: UmeƄ University, Sweden
Member

Hi.
I hereby post my code here. Hoping to receive help. I tried this but it didn't work.Thank you in advance.
*Age difference between partners*

gen wifemin = min(v034b_1, v034b_2, v034b_3, v034b_4, v034b_5, v034b_6, v034b_7, v034b_8)

gen agediff = (v012 - min(v034b_1, v034b_2, v034b_3, v034b_4, v034b_5, v034b_6, v034b_7, v034b_8) ///
recode agediff ( -75/0=0 "older wife or no difference") (1/10=1 "1-10yrs diff") (11/20=2 "11-20yrs diff")(21/30= 3 "21-30yrs diff") ///
(31/43 = 4 ">=31yrs diff") , generate (agediffcat)
label variable agediffcat "Age difference b/w husband/partner and wife/partner"
drop if agediff == 75
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Gambia DHS 2013
Next Topic: Mozambique INSIDA 2009 - generating age difference with last sexual partner for AGYW 15-24
Goto Forum:
  


Current Time: Sun Aug 14 09:34:39 Coordinated Universal Time 2022