The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Other countries » Daughter age at circumcision Mali 2006
Re: Daughter age at circumcision Mali 2006 [message #3303 is a reply to message #3257] Wed, 19 November 2014 14:11 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
Variable S915 is a composite variable with the first digit being a unit field and the last two digits being a number field. The easiest way to handle this is to split it into two parts. You can use the following code in Stata to do that:
gen s915u = int(s915/100)
gen s915n = mod(s915,100)
lab var s915u "Age of daughter at circumcision (units)"
lab var s915n "Age of daughter at circumcision (number)"
lab def s915u 1 "Age in years" 2 "In infancy" 3 "Age in months" 9 "Special answers"
lab def s915n 95 "In infancy" 98 "Don't know" 99 "Missing"
lab val s915u s915u
lab val s915n s915n
tab s915n s915u [iw=v005/1000000]

However when I looked at the data more closely and compared to the Mali 2006 report, it is apparent that there are errors in the coding and an error in the tabulation.

First the error in the coding. The unit code 2 (In infancy) in s915u should match up with code 95 (In infancy) in s915n, but there are cases with code 2 on s915u that have values 1-40 in s915n. I believe these should be code 3 on s915u for age in months, not code 2 (In infancy). Also, code 9 (Special answers) on s915u has numeric values 1-18 on s915n. These are probably keyer errors and could be either age in years or months, but I believe are most likely to be age in years (it is possible they are some of each - I don't think we can tell).

Second the error in the tabulation. When I tried to reproduce table 18.6 it was clear that the table just used s915n from above, assuming all ages were age in years, and ignoring that some were age in months.

Below is code that will first allow you to reproduce the table and then a correction for the age in months:
* Create age groups used in table 18.6 in Mali 2006 report
recode s915n (95=0)(0/1=1)(2/4=2)(5/9=3)(10/14=4)(15/94=5)(98/99=9), gen(age_exc)

* Add labels
lab var age_exc "Age of daughter at circumcision"
label def age_exc 0 "In infancy" 1 "0-1" 2 "2-4" 3 "5-9" 4 "10-14" 5 "15+" 9 "Don't know/missing"
label val age_exc age_exc

* Tabulate as in table 18.6 in Mali 2006 report
tab age_exc [iw=v005/1000000]

* Correction for reporting as age in months 
replace age_exc = 1 if  s915n< 24 & (s915u==2|s915u==3)
replace age_exc = 2 if (s915n>=24 & s915n<48) & (s915u==2|s915u==3)

* Re-tabulate withh correction
tab age_exc [iw=v005/1000000]

[Updated on: Wed, 19 November 2014 14:13]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Zimbabwe 2005-06 stratum number variable
Next Topic: Dominican Republic 2013
Goto Forum:
  


Current Time: Fri Oct 11 13:16:16 Coordinated Universal Time 2024