|
Re: The Gambia DHS [message #14730 is a reply to message #14528] |
Wed, 02 May 2018 15:51 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
Liz-DHS
Messages: 1516 Registered: February 2013
|
Senior Member |
|
|
Dear User,Please post your code. Someone in the user community may be able to help once they see what you have so far. Thank you!
|
|
|
Re: The Gambia DHS [message #14737 is a reply to message #14730] |
Wed, 02 May 2018 20:51 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to next message](/theme/default/images/down.png) |
sngacksowe@yahoo.com
Messages: 4 Registered: April 2018 Location: Umeå University, Sweden
|
Member |
![Sarata+Sowe](/theme/default/images/skype.png)
|
|
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
|
|
|
Re: The Gambia DHS [message #14761 is a reply to message #14528] |
Thu, 03 May 2018 17:54 ![Go to previous message Go to previous message](/theme/default/images/up.png) |
Liz-DHS
Messages: 1516 Registered: February 2013
|
Senior Member |
|
|
A response from senior technical expert, Dr. Tom Pullum:
Quote:
I believe you are working with the CR file. In that file, the woman's variables start with v and the man's variables start with mv, but this does not mean that there is a perfect correspondence between the men's variables and the women's variables. For example, the man's age is mv012 and the woman's age is v012. However, for the men, there are variables mv034b_*, but for women there are NO variables v034b_* . Your "wifemin" line requires changing each v to mv. Your "agediff" line requires changing v012 to mv012, and replacing the "min(....)" with the corrected "wifemin".
|
|
|