The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in SPSS » Calculating cases for IYCF
Calculating cases for IYCF Wed, 26 October 2016 14:05
 anuth Messages: 10Registered: November 2015 Location: Finland Member
Hello DHS team,

I am working on PDHS 2012-13 and calculating some IYCF variables. My cases should be the youngest child living with respondent who are less than 24 months. To calculate this i performed following steps in Under 5 years child file:

1. Select- Age of child <24 months
2. Select- Living with whom=0
3. Select- BIDX=1

But the number of child differ in my calculation and what is given in PDHS 2012-13 report.

My calculation is

Age group of child under 2 years
Frequency Percent Valid Percent Cumulative Percent
Valid Less than 6 months 1075 27,4 27,4 27,4
6 to 8 months 493 12,5 12,5 39,9
9 to 11 months 535 13,6 13,6 53,5
12 to 17 months 1123 28,6 28,6 82,1
18 to 23 months 703 17,9 17,9 100,0
Total 3929 100,0 100,0

But in PDHS 2012-13 report the total number of under 2 years child eligible for IYCF questionnaire is 3,206 ( from table 11.5, page 200)

Grateful if you could help me to find where i am wrong or what i am missing)

Thank you,
Anupa

A
Re: Calculating cases for IYCF [message #11100 is a reply to message #11097] Wed, 26 October 2016 18:12
 Trevor-DHS Messages: 799Registered: January 2013 Senior Member
This is a common misunderstanding. The youngest child living with the mother is not necessarily one with BIDX = 1. BIDX = 1 is for the last child born, but if the last child born had died or does not live with the mother, then the youngest child living with the mother may have BIDX = 2.

Try the following code:
```* Cases should be sorted already, but in case they are not
sort caseid bidx
* Last child in the last 2 years living with mother
* age in months
gen age = v008-b3
lab var age "Age in months"
* keep if under 24 months and living with mother
keep if age<24 & b9==0
* ... and keep the last born of those. If caseid is the same as the prior case, then not the last born.
drop if _n > 0 & caseid == caseid[_n-1]
* generate variable for still breastfeeding
recode m4 (95=1 "Still breastfeeding")(else=0 "Not breastfeeding"), gen(bf)
lab var bf "Currently breastfeeding"
* generate age groupings
recode age (0/5 = 0 "0-5")(6/8 = 1 "6-8")(9/11 = 2 "9-11")(12/17 = 3 "12-17")(18/23 = 4 "18-23"), gen(ageg)
lab var ageg "Age groups"

* tabulate current breastfeeding status by age group
tab ageg bf [iw=v005/1000000]```

Re: Calculating cases for IYCF [message #11411 is a reply to message #11100] Fri, 16 December 2016 02:51
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear DHS team and colleagues,
I recently analyzed the individual dataset for 2010 Malawi demographic and health survey and I used SPSS.I selected youngest children living with their mothers aged less than 24 months. I estimated the prevalence rates of child feeding practices but surprisingly my results didn't match those that are in the 2010 report. I found that Exclusive breastfeeding is at 95.5% instead of 71.4% and the rest of the other breastfeeding practices are also higher than expected. My concern is how can I go about to extract the variables for exclusive breastfeeding and predominant feeding since these were not clearly pointed out in the recode manual. Do I use current breastfeeding variable to estimate the exclusive breastfeeding rate? and for predominant feeding, do I compute some variables(drank plain water, juice and milk and breastmilk) to make one composite variable for predominant feeding? Also how do I manage the missing cases in these variables? I also tried the above suggestions to extract the appropriate sample size but still more there is a difference. Mine was 7333 and the report found a sample size of 7724.Any suggestions will be highly appreciated.

Thank you
Re: Calculating cases for IYCF [message #11421 is a reply to message #11411] Mon, 19 December 2016 08:49
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is a response from DHS Senior Research Associate, Shireen Assaf:

Quote:
To match the table for exclusive breastfeeding you would need to compute some variables such as drank any liquids or consuming any solids, etc. The code below can be used to match the table for exclusive breastfeeding. The estimate is 71.4% for children 0-5 months and the denominator is 1,698.

```** Exclusive breast feeding
use MWKR61FL.dta, clear

gen age=v008-b3

keep if b9==0

* finding the youngest child living with the mother for each mother
bysort v001 v002 v003: egen minbidx=min(bidx)
* keep only children less than 2 years
keep if age<24
* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx

gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0
gen bottle=0

*TO DETERMINE IF CHILD IS GIVEN WATER, SUGAR WATER, JUICE, TEA OR OTHER.
replace water=1 if (v409>=1 & v409<=7)

* IF GIVEN OTHER LIQUIDS
foreach xvar of varlist v409a v410 v410*  v413* {
replace liquids=1 if `xvar'>=1 & `xvar'<=7
}

cap replace liquids=1 if v412c>=1 & v412c<=7

* IF GIVEN POWDER/TINNED milk, FORMULA OR FRESH milk
foreach xvar of varlist v411 v411a v412 v414p {
replace milk=1 if `xvar'>=1 & `xvar'<=7
}

* IF STILL BREASTFEEDING
replace breast=1 if m4==95

* IF WAS EVER BOTTLE FED
replace bottle=1 if m38==1

*IF GIVEN ANY SOLID FOOD
foreach xvar of varlist v414* {
replace solids=1 if `xvar'>=1 & `xvar'<=7
}
replace solids=1 if v412a==1 | v412b==1

gen diet=7
replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0
replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0
replace diet=2 if            liquids==1 & milk==0 & solids==0
replace diet=3 if                         milk==1 & solids==0
replace diet=4 if                         milk==0 & solids==1
replace diet=5 if                         milk==1 & solids==1
replace diet=6 if breast==0

*diet=0: given only water (full bf)
*diet=1: given only liquids (bf & liquids)
*diet=2: given only milks (bf & milk)
*diet=3: given only solids (bf & solids)
*diet=4: given only milk and solids (bf & milk & solids)
*diet=5: not still breastfeeding (weaned)
*diet=6: not now being breastfed (m4~=95)

** Matching Table 11.3 for exclusive breast feeding in 0-5 month children **
gen ebf=0
replace ebf=1 if diet==0
ta ebf if age<6 [iw=v005/1000000]

```

Re: Calculating cases for IYCF [message #11422 is a reply to message #11421] Mon, 19 December 2016 09:43
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear Bridget,
Thank you so much for the response. Will work on the information you have given me and will give feedback once I come up with the results

Regards,
Rose
Re: Calculating cases for IYCF [message #11516 is a reply to message #11421] Fri, 06 January 2017 04:34
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear DHS team and colleagues,
I managed to find the exclusive breastfeeding rate that is similar to that of the Malawi DHS REPORT.However, am still finding challenges to find similar the predominant feeding rate and complementary feeding rate.my predominant feeding rate(0-5 months) was 75.64% and Malawi demographic health survey report rate is 77.5%.my complementary feeding rate(0-23months) is 22.15% and the rate in the report is 19%.i did the following to get the rates

following the previous given code
gen diet=7
replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0
replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0
replace diet=2 if liquids==1 & milk==0 & solids==0
replace diet=3 if milk==1 & solids==0
replace diet=4 if milk==0 & solids==1
replace diet=5 if milk==1 & solids==1
replace diet=6 if breast==0

*diet=0: given only water (full bf)
*diet=1: given only liquids (bf & liquids)
*diet=2: given only milks (bf & milk)
*diet=3: given only solids (bf & solids)
*diet=4: given only milk and solids (bf & milk & solids)
*diet=5: not still breastfeeding (weaned)
*diet=6: not now being breastfed (m4~=95)

*To calculate predominant breastfeeding rate
gen pred=0
replace pred=1 if diet==1
replace pred=1 if diet==0

*To calculate complementary feeding
gen comp=0
replace comp=1 if diet==2
replace comp=1 if diet==3
replace comp=1 if diet==4

Could anyone advise me on the above percentages, if the differences I have found are acceptable or not and also if I used the right syntax to calculate the variables for predominant feeding and complementary feeding. Your assistance will be highly appreciated.

Regards,
Rose

Re: Calculating cases for IYCF [message #11522 is a reply to message #11516] Sun, 08 January 2017 09:34
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear DHS team and colleagues,
I managed to find the exclusive breastfeeding rate of 71.4% which is similar to that of the 2010 Malawi DHS REPORT but surprisingly the denominator(0-5 months) is 1656 instead of 1698,i tried key in the codes that I was given previously several times using Stata but I keep getting the same denominator(1656) .Iam also still finding challenges to find the correct predominant feeding and complementary feeding rate estimate.my predominant feeding rate(0-5 months) was 75.64% and Malawi demographic health survey report rate is 77.5%.my complementary feeding rate (0-23months) is 22.15% and the rate in the report is 19%.I used every step of the code that I was previously given to get the EXCLUSIVE BREASTFEEDING rate(please find it below).I have also indicated how I got the predominant and complementary feeding rate.

** Exclusive breast feeding
use MWKR61FL.dta, clear

gen age=v008-b3

keep if b9==0

* finding the youngest child living with the mother for each mother
bysort v001 v002 v003: egen minbidx=min(bidx)
* keep only children less than 2 years
keep if age<24
* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx

gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0
gen bottle=0

*TO DETERMINE IF CHILD IS GIVEN WATER, SUGAR WATER, JUICE, TEA OR OTHER.
replace water=1 if (v409>=1 & v409<=7)

* IF GIVEN OTHER LIQUIDS
foreach xvar of varlist v409a v410 v410* v413* {
replace liquids=1 if `xvar'>=1 & `xvar'<=7
}

cap replace liquids=1 if v412c>=1 & v412c<=7

* IF GIVEN POWDER/TINNED milk, FORMULA OR FRESH milk
foreach xvar of varlist v411 v411a v412 v414p {
replace milk=1 if `xvar'>=1 & `xvar'<=7
}

* IF STILL BREASTFEEDING
replace breast=1 if m4==95

* IF WAS EVER BOTTLE FED
replace bottle=1 if m38==1

*IF GIVEN ANY SOLID FOOD
foreach xvar of varlist v414* {
replace solids=1 if `xvar'>=1 & `xvar'<=7
}
replace solids=1 if v412a==1 | v412b==1

gen diet=7
replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0
replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0
replace diet=2 if liquids==1 & milk==0 & solids==0
replace diet=3 if milk==1 & solids==0
replace diet=4 if milk==0 & solids==1
replace diet=5 if milk==1 & solids==1
replace diet=6 if breast==0

*diet=0: given only water (full bf)
*diet=1: given only liquids (bf & liquids)
*diet=2: given only milks (bf & milk)
*diet=3: given only solids (bf & solids)
*diet=4: given only milk and solids (bf & milk & solids)
*diet=5: not still breastfeeding (weaned)
*diet=6: not now being breastfed (m4~=95)

** Matching Table 11.3 for exclusive breast feeding in 0-5 month children **
gen ebf=0
replace ebf=1 if diet==0
ta ebf if age<6 [iw=v005/1000000]

*To calculate predominant breastfeeding rate I used this code
gen pred=0
replace pred=1 if diet==1
replace pred=1 if diet==0

*To calculate complementary feeding
gen comp=0
replace comp=1 if diet==2
replace comp=1 if diet==3
replace comp=1 if diet==4

Could anyone please advise me on the above percentages, if the differences I have found are acceptable or not;also if I missed any step to calculate the variables for exclusive breastfeeding, predominant feeding and complementary feeding. Your assistance will be highly appreciated.

Regards,
Rose

Re: Calculating cases for IYCF [message #11531 is a reply to message #11522] Mon, 09 January 2017 09:04
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is a response from DHS Senior Research Associate, Shireen Assaf:

After creating your water, liquid, milk and solid variables, please use the following code to match the report.

```gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label val feeding feeding

*complimentary feeding is category #5 (+solids) and this matches the report for this age group which is 19.1%
ta feeding if age<6 [iw=v005/1000000]

*creating the predominant breastfeeding variable.
recode feeding (0 4 5=0) (1/3=1), gen(predom)

*this matches the report of 77.5% for predominant breastfeeding
ta predom if age<6 [iw=v005/1000000]
```
Re: Calculating cases for IYCF [message #11532 is a reply to message #11531] Mon, 09 January 2017 09:19
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear Bridget,
Thank you so much for the response and assistance, will use the code as stated and will give feedback

Regards,
Rose
Re: Calculating cases for IYCF [message #11554 is a reply to message #11532] Tue, 10 January 2017 08:55
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is an additional response from DHS Senior Research Associate, Shireen Assaf:

The denominator of 1656 is correct. In Table 11.3 this is the number of youngest children under age 2 (10th column), the 1698 is the number of all children under age 2 (12 column or last column). For matching the predominant feeding and complimentary feeding please use the provided code which creates the feeding variable and recodes this variable to obtain predominant feeding.
Re: Calculating cases for IYCF [message #11555 is a reply to message #11554] Tue, 10 January 2017 09:06
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear Bridget,
Thank you so much for the clarification, I have cross checked in the report, its clear now. For the predominant and complementary feeding I also managed to get the rate that matches with the report. Thank you so much for the assistance, I really appreciate.

Regards,
Rose
Re: Calculating cases for IYCF [message #12184 is a reply to message #11531] Thu, 06 April 2017 07:32
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear DHS team and colleagues,
I am trying to analyze data from the 2010 Malawi DHS using Stata and I am looking at the prevalence rate of child feeding practices like exclusive breastfeeding,predominant,early initiation of breast feeding, complementary feeding and bottle feeding which I managed to get through assistance rendered on this forum. To calculate predominant feeding and complementary feeding I was given the following syntax

gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label var feeding feeding

*complimentary feeding is category #5 (+solids) and this matches the report for this age group which is 19.1%
ta feeding if age<6 [iw=v005/1000000]

*creating the predominant breastfeeding variable.
recode feeding (0 4 5=0) (1/3=1), gen(predom)

*this matches the report of 77.5% for predominant breastfeeding
ta predom if age<6 [iw=v005/1000000]

Now I was wondering if it is also possible to extract bottle feeding for 0-5 months which is 1.9% from the same variable "FEEDING" regardless of the fact that bottle feeding already exists as a separate variable(m38). My main issue is I want to be able to get a total of 100 when I add up complementary feeding,exclusive,predominant and bottle-feeding for 0-5 months. Your favorable assistance will be highly appreciated.

Regards,
Rose
Re: Calculating cases for IYCF [message #12190 is a reply to message #12184] Thu, 06 April 2017 14:33
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member

Following is a response from DHS Senior Research Associate, Shireen Assaf:

From what I understand from your question you would like to recode the feeding variable in a way that contains a category that is bottle feeding. However, none of the variables used to construct the feeding variable include the variable on whether the child was bottle fed or not. The feeding variable is only concerned with the types of food and not the mechanism the food was delivered. The closest thing I could think of was to recode it as follows:

recode feeding (0=0 "not breastfed") (1=1 ebf) (2/3=2 "liquid+water") (4=3 "other milk") (5=4 "complimentary feeding"), gen(feed2)

This would give you the categories of not-breastfed, exclusive breastfeeding, liquid+water, other milk, and complimentary feeding. Predominate feeding is the combination of ebf and liquid+water, so you could combine the categories 1 and 2 above if you are interested in having that category. Of course you could not have ebf and predominate breastfeeding as two separate categories since predominate breastfeeding includes the exclusive breastfeeding category. The "other milk" category can be the closest thing to bottle feeding perhaps, but I'm not sure about this. Here I am making the assumption that the children that are given other types of milk are given this milk through a bottle. However, really if you want to know about whether the child was bottle fed you need m38 but this would not be part of the feeding variable.

I guess my confusion is why you need this to total to 100, because the categories you mention are not mutually exclusive. For instance, bottle-feeding and predominant feeding may not separate as you could bottle feed the child with liquids other than milk.
Re: Calculating cases for IYCF [message #12199 is a reply to message #12190] Fri, 07 April 2017 11:01
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear Bridgette,
Thank you so much for your response. It has been helpful. The reason why I needed the practices to total to 100 is that, I understand that these breastfeeding practices were extracted from the same population. For example, if we try to look at bottle feeding,predominant,exclusive breastfeeding and complementary feeding for 0-5 months, we find that it was extracted from the same population of 1656 yet when we try to combine these practices the total is about 101.4.So I guess my confusion was if the 'other milk' category as well as some components of complementary feeding and predominant feeding be the closest thing to bottle feeding. So I just wanted to be sure before I run a logistic regression with bottle feeding which happens to be one of the main outcomes(dependent variable).

Thanks,
Rose
Re: Calculating cases for IYCF [message #12603 is a reply to message #11555] Wed, 21 June 2017 05:58
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
good day, i have read all the messages in the thread, but i still need some help please. i am working on exclusive and predominant breastfeeding using the 2003, 2008 and 2013 Nigerian DHS dataset.
firstly, i would like to clarify if it is alright to use the birth recode file, because i have seen that most people have been using the kids recode file.
secondly, i would like directions in SPSS as that is the software i know how to use. what i have done is not matching with the result in the NDHS report and i would be grateful if clarifications can be made.
using the 2013 birth recode file, I selected cases if b8 < 6 (because the population I am working with is babies less than 6 months)
next, I recoded into a different variable all the feeds given, for example if child was given plain water 0 = no, 1 and 8 = yes. original label in the dataset is 0= no, 1 = yes, 8 = dont know.
for EBF, I added those who were currently breastfeeding and had 0 in all the foods listed, I have a list of 21 foods (v409, v410, v411, v411A, v412A, v412C, v413, v414E, v414F, v414G, v414H, v414I, v414J, v414K, v414L, v414M, v414N, v414O, v414P, v414S, v414V)

I did not get the same result as in the report. I would like to know how to go about this.
Thanks so much
Re: Calculating cases for IYCF [message #12605 is a reply to message #12603] Wed, 21 June 2017 08:36
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The first problem I see is that b8 gives age in years, not months. In the surveys you are using, age 0-5 completed months is given by v008-b3<6. The SPSS code for EBF and partial BF is given in the attached text file. You may have to modify it slightly based on the specific codes in these surveys. You may also want to look at this: http://www.ghspjournal.org/content/2/3/355.full.
Let us know if you still cannot get a match. Good luck!
Re: Calculating cases for IYCF [message #12607 is a reply to message #12605] Wed, 21 June 2017 18:03
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
Thanks so much, this has been really helpful. I have run the syntax but I am getting values a little different from the NDHS report values, for example, I got a 17.2% for EBF, whereas the report states a 17.4% I would like to know if there's an explanation for this or if I'm not doing something right. Thanks

I have used HW1 as age in months and I got the same result as using v008-b3.

Re: Calculating cases for IYCF [message #12609 is a reply to message #12605] Thu, 22 June 2017 08:59
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
In calculating predominant breastfeeding rate, I got 69.4%, whereas the reports states 69%, please I want to be sure that it is just approximation issues before I continue.
In addition, I would also like to know if the syntax can be used to calculate EBF and PBF for the other years too, that is for 2003 and for 2008. Thanks for your help.
Re: Calculating cases for IYCF [message #12611 is a reply to message #12609] Thu, 22 June 2017 09:55
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum:

Yes, we would consider that to be a match. The code should be basically the same for all surveys. The only thing that you need to check is the numbers and letters for the variables on liquids, etc. Please proceed and see whether you get a match for 2003 and 2008.

We don't have SPSS code for the other years. If necessary, I can send you the CSPro code which was used for those surveys. You would have to translate it to SPSS. You should be able to do that.
Re: Calculating cases for IYCF [message #12612 is a reply to message #12611] Thu, 22 June 2017 10:10
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member

Another response from Senior DHS Stata Specialist, Tom Pullum:

Yes, hw1 is calculated as v008-b3. You can use that for completed months of age. For which survey did you get 17.2% instead of 17.4%?

Re: Calculating cases for IYCF [message #12614 is a reply to message #12611] Thu, 22 June 2017 10:42
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
Thanks so much, I'm happy that's a match. I will go ahead and try it for the previous years and give u a feedback. You could also kindly send me the codes, I dont know how to translate to SPSS, but i will find a way to and if I can't get around it, I will be sure to let you know. I am really very grateful for your help.

Re: Calculating cases for IYCF [message #12615 is a reply to message #12612] Thu, 22 June 2017 11:06
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
That was for the 2013 Nigerian DHS. Thanks
Re: Calculating cases for IYCF [message #12616 is a reply to message #12612] Thu, 22 June 2017 11:15
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
I mean that I got the 17.2% as the EBF prevalence for the year 2013, though the report states 17.4%. Thanks so much again.

Re: Calculating cases for IYCF [message #12617 is a reply to message #12616] Thu, 22 June 2017 14:50
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
We have sent a reply to the email address you registered on the Forum. Thanks for using DHS data.

Re: Calculating cases for IYCF [message #12632 is a reply to message #12611] Tue, 27 June 2017 08:09
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
Good day Sir/Ma,
I am extremely grateful for all the help. I was able to use the syntax sent to compute EBF and Predominant breastfeding (PBF) rates for the three years 2003, 2008 and 2013. I had to adjust the syntax to compute EBF and PBF for 2008 and 2003, as the variables were different for the two other years. I am using the Nigerian DHS dataset (birth recode files) and I got the following rates:
2003 - EBF 17.1%, PBF 52.9%
2008 - EBF 13%, PBF 43.1%
2013 - EBF 17.2%, PBF 69.9%

from the NDHS reports, the prevalences reported were:
2003 - EBF -17.2%, PBF 53%
2008 - EBF - 13.1%, PBF 43.6%
2013 - EBF - 17.4%, PBF - 69%

I would like to confirm again, that all these are taken as matches when compared to the reports.

My next dilemma now is can I merge all the 3 years (2003, 2008 and 2013) before commencing on further analysis? I ask these because the variables are different especially in 2003, where the variables regarding foods given to children less than 6 months are v469A, v46B....v469Y, whilst for 2008 and 2013, the variables are v409 ...v14

Lastly, I am a little confused with the Recode files. Please I would like to know if there is a specific recode file for each year. I have downloaded Recode2, Recode3, Recode4, Recode5 and Reecode6. I would like to be sure which recode is for which dataset.

Thanks again,

Re: Calculating cases for IYCF [message #12634 is a reply to message #12632] Tue, 27 June 2017 10:20
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

Yes, we would agree that you have satisfactorily matched the reports. You are thinking of appending the files, not merging them. Apparently you want to combine the three surveys into a single file. I would not recommend that you combine into a single file unless you have a really good reason for doing that. As you note, if you do that, you have to switch to a common set of codes for all three surveys. If you proceed, there will be no alternative to doing your best to construct a common set of codes. This could be difficult or even impossible if the questionnaires were too different.

The names of the IR files for the 2003, 2008, and 2013 surveys are NGIR4B, NGIR53, and NGIR6A, respectively. You should only be using the 4B, 53, and 6A files.

Recoden refers to the recode structure that was used in the survey. If you look at column 4: Recode on the available datasets listing, you will see the "recode" that was used for each survey.

[Updated on: Tue, 27 June 2017 10:24]

Report message to a moderator

Re: Calculating cases for IYCF [message #12636 is a reply to message #12634] Tue, 27 June 2017 15:41
 adenikedegun Messages: 10Registered: June 2017 Location: nigeria Member
Wow, this has been really helpful. Thanks a great deal.

Re: Calculating cases for IYCF [message #13341 is a reply to message #11421] Wed, 25 October 2017 14:14
 Sajhama Messages: 28Registered: July 2017 Member
Hello there,

I am able to get the right number of result as in result for table 11.2 of Nepal DHS 2011 for the categories, percentage ever breastfed, number of last born children and number of last born ever breastfed crosstab by sex. However, for table 11.3, result are same for "not breastfeeding", "Number of youngest children under two years living with their mother", "Number of all children under two years" but percentage currently breastfeeding is slightly different, mine is 98.5 for 0-1 months instead of 98.2 . When value for "Number of youngest children under two years living with their mother" and "Number of all children under two years" are same, how can the percentage vary for currently breastfeeding??

Another main problem is with exclusive breastfeeding and breastfeeding along with water and so on, the percentages different by few numbers (SPSS output file is attached) when I followed the codes attached . I am somewhere making error in selecting youngest children rather than last born, I think.

I am looking for creating matching table 11.3 of Nepal DHS.

Here are the codes I used.
COMPUTE age=V008 - B3.
EXECUTE.

* Select children living with the mother.
FILTER OFF.
USE ALL.
SELECT IF (B9=0).
EXECUTE.

AGGREGATE (I AM SO CONFUSED WITH THIS, SINCE WE HAVE TO GO FOR YOUNGEST CHILDREN, RATHER THAN LAST BORN, IS THE CODE CORRECT? BECAUSE SOMETIME spss SHOWED ERROR WHEN I RUN IT IN SYNTAX.
/BREAK=V001 V002 V003
/BIDX_min=MIN(BIDX).

SELECT IF (BIDX_min = BIDX) .
EXECUTE.

* Select children age below 24.
FILTER OFF.
USE ALL.
SELECT IF ( age < 24).
EXECUTE.

* Create age gropus.
RECODE age (0 thru 1=1) (2 thru 3=2) (4 thru 5=3) (6 thru 8=4) (9 thru 11=5) (12 thru 17=6) (18
thru 23=7) INTO age_grp.
VARIABLE LABELS age_grp 'age group'.
EXECUTE.

VALUE LABELS age_grp 1 " 0-1 month" 2 "2-3 months" 3 "4-5 months" 4 "6-8 months" 5 "9-11 months" 6 "12-17 months" 7 "18-23 months".

*23-06-2017.
COMPUTE water = 0.
EXECUTE.

COMPUTE liquids = 0.
EXECUTE.

COMPUTE milk= 0.
EXECUTE.

COMPUTE solid= 0.
EXECUTE.

COMPUTE bottle= 0.
EXECUTE.
COMPUTE breast= 0.
EXECUTE.

* to determine if child is given water.

DO IF (V409 >= 1 & V409 <= 7).
RECODE water (0=1).
END IF.
EXECUTE.

*To determine if Child is given liquids.
DO IF ((V410 >= 1 & V410 <= 7) | (V412c >= 1 & V412c <= 7) | (V413 >= 1 & V413 <= 7)) .
RECODE liquids (0=1).
END IF.
EXECUTE.

* to determine if child is given milk.

DO IF ((V411 >= 1 & V411 <= 7) | (V411a >= 1 & V411a <= 7)).
RECODE milk (0=1).
END IF.
EXECUTE.

*To determine if child drank from bottle with nipple.

DO IF (M38= 1 ).
RECODE bottle (0=1).
END IF.
EXECUTE.

*To determine if Child is given Solid.

DO IF ((V412A >=1 & V412A<=7) | (V414E >= 1 & V414E <= 7) | (V414F >=1 & V414F <=7) | (V414G >=1 & V414G <=7) | (V414H >=1 & V414H <=7) |
(V414I >=1 & V414I <=7) | (V414J >=1 & V414J <=7) | (V414K >=1 & V414K <=7) | (V414L >=1 & V414L<=7) | (V414M>=1 & V414M<=7) |
(V414N >=1 & V414N <=7) | (V414O >=1 & V414O <=7) | (V414P >=1 & V414P <=7) | (V414S >=1 & V414S <=7) | (V414V >=1 & V414V <=7)).
RECODE Solid (0=1).
END IF.
EXECUTE.

*To determine if child is still breastfeeding.

DO IF (M4= 95).
RECODE breast (0=1).
END IF.
EXECUTE.
VALUE LABELS breast 0 "Not breastfeeding" 1 " Still breastfeeding".

*Matching Table 11.3 for exclusive breast feeding in 0-5 month children.

COMPUTE feeding=7.
EXECUTE.

* exclusive breastfeeding.
DO IF (water = 0 & liquids = 0 & Milk = 0 & Solid = 0).
RECODE feeding (7=1).
END IF.
EXECUTE.

* breastfeeding + water.
DO IF (water = 1 & liquids = 0 & Milk = 0 & Solid = 0).
RECODE feeding (7=2).
END IF.
EXECUTE.

* breastfeeding + liquids.
DO IF ( liquids = 1 & milk = 0 & solid = 0).
RECODE feeding (7=3).
END IF.
EXECUTE.

* breastfeeding + milk.
DO IF (milk = 1 & solid = 0).
RECODE feeding (7=4).
END IF.
EXECUTE.

* breastfeeding + solid.
DO IF (solid = 1).
RECODE feeding (7=5).
END IF.
EXECUTE.

* Not breastfeeding.
DO IF (breast= 0).
RECODE feeding (7=0).
END IF.
EXECUTE.

VALUE LABELS feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids".

COMPUTE wt=v005/1000000.
EXECUTE.

I am really in need of your help, struggling too with calculation of exclusive breast feeding for Nepal.
Sajama
• Attachment: Output1.spv
Re: Calculating cases for IYCF [message #13351 is a reply to message #13341] Thu, 26 October 2017 13:13
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member

Following is a response from DHS Senior Research Associate, Shireen Assaf:

The Stata code below will match table 11.3 on page 172 of the Nepal 2011 DHS Final report. The feeding variable will give the breakdown of the first 6 columns in the table (not breastfeeding, ebf, etc.) and the breast variable will give the currently breastfeeding percentages. These are cross-tabulated with the variable age2 which was recoded to match the age groups in the table. I use bysort to select the youngest child living with the mother then drop those that are 2 years and above.
Re: Calculating cases for IYCF [message #13352 is a reply to message #13351] Thu, 26 October 2017 14:56
 Sajhama Messages: 28Registered: July 2017 Member
Hello Bridgette,

Thank you very much for your time and effort.

I am doing it again and again and this time, my result are quiet closer to the one in report. Another thing I experienced is, the output differs when I run syntax and do it manually in SPSS but don't know why. The result are same for exclusive breastfeeding and exbf with water, solid etc for some of the age group but in some other age group, it differ by few points and in some by few percentages, can be noticed from the attached file. In this case, will my result be valid if differs by few points?

My result are same for initiation of breastfeeding within one hour and a day as in Table 11.2, number of youngest children living with mother and etc.

Thank you once again.
S

Re: Calculating cases for IYCF [message #14468 is a reply to message #13352] Tue, 10 April 2018 13:18
 Chris Messages: 6Registered: April 2018 Member
Dear DHS team,
I am analyzing 2015-2016 Malawi DHS data. I am interested in finding out postnatal care utilisation by women who had given birth 2 years preceding the survey using SPSS. Which variable should I use to restrict my analysis to women who gave birth in 2 years preceding the survey? I tried to restrict to children who were aged 0 to 24 months during the time of the survey. However, what I am getting is different with the one in the report. For instance, in the report there is 6693 while I am getting 6952 after applying sample weights.
Any suggestions will be highly appreciated.

Thanks
Re: Calculating cases for IYCF [message #14474 is a reply to message #14468] Tue, 10 April 2018 17:31
 Trevor-DHS Messages: 799Registered: January 2013 Senior Member
We changed the calculation of age in more recent surveys - see https://blog.dhsprogram.com/child-age/ and https://www.dhsprogram.com/data/calculating-the-age-of-child ren.cfm for more details.

I suggest trying
`if b19 < 24`
Re: Calculating cases for IYCF [message #14483 is a reply to message #14474] Wed, 11 April 2018 12:24
 Chris Messages: 6Registered: April 2018 Member
Dear Trevor and DHS team,

Thanks for your help, it has worked well.

However, I am using 2015-2016 Malawi DHS data to estimate the proportion of mothers who received postnatal check-up, but my results are not matching with the results in the report. I do not see any variable with the options regarding receiving postnatal care within 2 days. Using SPSS, which variables can I use to estimate:

1. Whether a mother received postnatal checkup or not?
2. Whether a mother had postnatal check within 2 days after delivery

Or how can I recode the variables to achieve my objective.

Thanks
Re: Calculating cases for IYCF [message #14496 is a reply to message #14483] Fri, 13 April 2018 01:32
 Chris Messages: 6Registered: April 2018 Member
Dear Trevor,
Using the same dataset(2015-2016 Malawi DHS), which variables can I use to estimate:

1. Whether a mother received postnatal checkup or not?
2. Whether a mother had postnatal check within 2 days after delivery

I do not see any variable with the options regarding receiving postnatal care within 2 days. I am Using SPSS.

Re: Calculating cases for IYCF [message #14971 is a reply to message #11554] Wed, 23 May 2018 00:53
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear DHS team and colleagues,
I recently analyzed breastfeeding practices (Early initiation of breastfeeding, exclusive breastfeeding, bottle feeding and predominant breastfeeding) for the 2010 Malawi Demographic and health survey using STATA. The sample was children less than 24 months. I managed to find rates that match with the report. Now I was trying to do the same for the 2015 Malawi Demographic and Health Survey using the same SYNTAX (sampling weight of[iw=v005/1000000]) that I had used for my previous analysis. Unfortunately, I don't seem to find the rates that match with the 2015 MDHS report. For instance, I found exclusive breastfeeding for 0-5 months= 64%; bottle feeding for 0-5 months=3.15%; predominant breastfeeding=11.45%. Any suggestions on how I can go about the analysis using STATA? Your assistance will be highly appreciated

Regards,

Rose
Re: Calculating cases for IYCF [message #14981 is a reply to message #14971] Wed, 23 May 2018 09:24
 Bridgette-DHS Messages: 3087Registered: February 2013 Senior Member
Following is a response from DHS Technical Specialist, Rukundo Benedict:

Dear User,

I suspect the issue may have to do with the age calculation. For age in the 2015-16 Malawi DHS, you should use the b19 variable as follows:

```* keep only children less than 2 years -->N.B.from 2016 surveys onwards use the b19 variable for age*
gen age=b19
keep if age<24
* keep last born children
keep if bidx==1
ta age [iw=wgt]
```

The above should select the correct sample and assuming your other code is correct, you will match the report.

Re: Calculating cases for IYCF [message #14985 is a reply to message #14981] Wed, 23 May 2018 19:48
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Dear Bridgette,
Thank you so much for your kind help. I tried to replace the variable for age using the syntax you gave me. However, the age seems not to match with that of the report. For instance, the total sample for children aged 0-5 months who practiced exclusive breastfeeding is 1715; for 9-11 months it is 888. Kindly enlighten me on where I might have gone wrong. Below is the SYNTAX that I used to create the age variable and breastfeeding practices (early initiation of breastfeeding, exclusive breastfeeding, predominant breastfeeding and bottle feeding:

gen age=b19

keep if age<24

. keep if bidx==1

ta age [iw=v005/1000000]

. gen water=0

.
. gen liquids=0

.
. gen milk=0

.
. gen solids=0

.
. gen breast=0

.
. gen bottle=0

. replace water=1 if (v409>=1 & v409<=7)

. replace liquids=1 if v409a>=1 & v409a<=7

.
. replace liquids=1 if v410>=1 & v410<=7

.
. replace liquids=1 if v410>=1 & v410<=7

. replace liquids=1 if v410a>=1 & v410a<=7

. replace liquids=1 if v413>=1 & v413<=7

. replace liquids=1 if v413a>=1 & v413a<=7

. replace liquids=1 if v413b>=1 & v413b<=7

. replace liquids=1 if v413c>=1 & v413c<=7

. replace liquids=1 if v413d>=1 & v413d<=7

. capture replace liquids=1 if v412c>=1 & v412c<=7

. replace milk=1 if v411>=1 & v411<=7

.
. replace milk=1 if v411a>=1 & v411a<=7

.
. replace milk=1 if v412>=1 & v412<=7

.
. replace milk=1 if v414p>=1 & v414p<=7

. replace breast=1 if m4==95

. replace bottle=1 if m38==1

. replace solids=1 if v414a>=1 & v414a<=7

. replace solids=1 if v414b>=1 & v414b<=7

. replace solids=1 if v414c>=1 & v414c<=7

. replace solids=1 if v414d>=1 & v414d<=7

. replace solids=1 if v414e>=1 & v414e<=7

. replace solids=1 if v414f>=1 & v414f<=7
. replace solids=1 if v414h>=1 & v414h<=7

. replace solids=1 if v414g>=1 & v414g<=7

. replace solids=1 if v414i>=1 & v414i<=7

. replace solids=1 if v414j>=1 & v414j<=7

. replace solids=1 if v414k>=1 & v414k<=7

. replace solids=1 if v414l>=1 & v414l<=7
. replace solids=1 if v414m>=1 & v414m<=7

. replace solids=1 if v414n>=1 & v414n<=7

. replace solids=1 if v414o>=1 & v414o<=7

. replace solids=1 if v414p>=1 & v414p<=7

. replace solids=1 if v414q>=1 & v414q<=7
. replace solids=1 if v414r>=1 & v414r<=7

. replace solids=1 if v414s>=1 & v414s<=7
. replace solids=1 if v414t>=1 & v414t<=7
. replace solids=1 if v414u>=1 & v414u<=7
. replace solids=1 if v412a==1 | v412b==1
. gen diet=7

. replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0

.
. replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0

.
. replace diet=2 if liquids==1 & milk==0 & solids==0

.
. replace diet=3 if milk==1 & solids==0

.
. replace diet=4 if milk==0 & solids==1

.
. replace diet=5 if milk==1 & solids==1

.
. replace diet=6 if breast==0

ta diet if age<6 [iw=v005/1000000]

. gen ebf=0

. replace ebf=1 if diet==0

. ta ebf if age<6 [iw=v005/1000000]

. * generate age groupings
recode age (0/5 = 0 "0-5")(6/8 = 1 "6-8")(9/11 = 2 "9-11")(12/17 = 3 "12-17")(18/23 = 4 "18-23"), gen(ageg2)
lab var ageg2 "Age groups"
tab ageg2

generate age groupings
recode age (0/1 = 0 "0-1")(2/3 = 1 "2-3")(4/5 = 2 "4-5")(6/11 = 3 "6-11")(12/23 = 4 "12-23"), gen(ageg5)
lab var ageg5 "Age groups2"
tab ageg5

tabulate exclusive breastfeeding status by age group
tab ageg2 ebf [iw=v005/1000000]
tab ageg2 ebf
gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+complementary"
label var feeding feeding

ta feeding if age<6 [iw=v005/1000000]

/*complimentary feeding is category #5 (+solids) and this matches the report for this age group which is 19.1%*/
ta feeding if age<6 [iw=v005/1000000]
tab ageg2 feeding [iw=v005/1000000]
/*creating the complementary feeding variable*/
recode feeding (0 1 2 3 4=0) (5=1), gen(comp)
tab ageg2 comp [iw=v005/1000000]

/*creating the missing variable*/
recode feeding (1 2 3 4 5=0) (0=1), gen(miss)
tab ageg2 miss [iw=v005/1000000]
ta miss if age<6 [iw=v005/1000000]

/*creating the predominant breastfeeding variable*/
recode feeding (0 4 5=0) (1/3=1), gen(predom)

/*this matches the report of 77.5% for predominant breastfeeding*/
ta predom if age<6 [iw=v005/1000000]

tab ageg2 predom [iw=v005/1000000]

*creating the predominant breastfeeding variable.
recode feeding (0 1 4 5=0) (2 3=1), gen(predom2)

tab ageg2 predom2 [iw=v005/1000000]
ta predom2 if age<6 [iw=v005/1000000]

/*bottlefeeding*/
ta bottle if age<6 [iw=v005/1000000]

tab ageg2 bottle [iw=v005/1000000]

ta bottle if age<24 [iw=v005/1000000]

/*Early initiation of breastfeeding within an hour 0-23 months*/
ta m34 if age<24 [iw=v005/1000000]

or
ta v426 if age<24 [iw=v005/1000000]

* generate age groupings
recode age (0/11 = 0 "0-11")(12/23 = 1 "12-23"), gen(ageg3)
lab var ageg3 "Age groups"

tabulate early initiation of breastfeeding status by age group
recode m34 (100= 1 "immediately")(1 199 200= 2 "hours")(1 999 .= 3 "days"), gen(earlyinit)
lab var earlyinit "EIBF"
tab earlyinit
tab ageg3 earlyinit [iw=v005/1000000]

tab ageg5 initiat [iw=v005/1000000]

recode earlyinit (1=1 "yes") (2 3 101 201=0 "No"),gen(initiat)
lab var initiat "EIBF"
tab initiat
tab ageg3 initiat [iw=v005/1000000]

Regards,

Rose

Re: Calculating cases for IYCF [message #14987 is a reply to message #14985] Thu, 24 May 2018 04:48
 Mlue Messages: 92Registered: February 2017 Location: North West Senior Member
Hi Roselync,

Try this one, maybe it may help you replicate tables 11.2 and 11.3

FOR TABLE 11.2
```/*
USE THE CHILDREN'S RECODE: MWKR7HFL
Malawi: Standard DHS, 2015-16

BY: Mluleki Tsawe
{University of the Western Cape, South Africa}

TO REPLICATE TABLE 11.2 - INITIAL BREASTFEEDING
*/

clear all
set matsize 800
set maxvar 10000
set mem 1g
use "MWKR7HFL", clear
set more off

********************************************************************************

** WEIGHT VARIABLE
gen weight = v005/1000000

********************************************************************************

** SURVEY SET
gen psu =    v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized)
*svydes

********************************************************************************

// RENAME

rename v013 age_woman
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
*rename sdist district

////////////////////////////////////////////////////////////////////////////////

// GENERATING DEPENDENT VARIABLES

gen child_age=b19

recode child_age (0/1=1 "0-1") (2/3=2 "2-3") (4/5=3 "4-5") (6/8=4 "6-8") ///
(9/11=5 "9-11") (12/17=6 "12-17") (18/23=7 "18-23") (else=.), gen(child_age_grp)
svy: tab child_age_grp, count format(%4.0f)

* keep only children less than 2 years
keep if child_age<24
*keep if b9==0* /* not needed for this table*/

* finding the youngest child living with the mother for each mother
bysort v001 v002 v003: egen minbidx=min(bidx)

* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx
/*keep if bidx <= minbidx*/

gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0
gen bottle=0

*TO DETERMINE IF CHILD IS GIVEN WATER, SUGAR WATER, JUICE, TEA OR OTHER.
replace water=1 if (v409>=1 & v409<=7)

* IF GIVEN OTHER LIQUIDS
foreach xvar of varlist v409a v410 v410*  v413* {
replace liquids=1 if `xvar'>=1 & `xvar'<=7
}
*
cap replace liquids=1 if v412c>=1 & v412c<=7

* IF GIVEN POWDER/TINNED milk, FORMULA OR FRESH milk
foreach xvar of varlist v411 v411a v412 v414p {
replace milk=1 if `xvar'>=1 & `xvar'<=7
}
*

* IF STILL BREASTFEEDING
replace breast=1 if m4==95

* IF WAS EVER BOTTLE FED
replace bottle=1 if m38==1

gen bottle2=0
replace bottle2 = 1 if m38==1 & inrange(m4,93,99)
replace bottle2 = 0 if (m38==0 & m38==9) & inrange(m4,93,99)

*IF GIVEN ANY SOLID FOOD
foreach xvar of varlist v414* {
replace solids=1 if `xvar'>=1 & `xvar'<=7
}
*
replace solids=1 if v412a==1 | v412b==1

cap drop diet
gen diet=.
replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0
replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0
replace diet=2 if            liquids==1 & milk==0 & solids==0
replace diet=3 if                         milk==1 & solids==0
replace diet=4 if                         milk==0 & solids==1
replace diet=5 if                         milk==1 & solids==1
replace diet=6 if breast==0

label define diet 	0"given only water" 1"given only liquids" 2"given only milks" ///
3"given only solids" 4"given only milk and solids" 5"not still breastfeeding" ///
6"not now being breastfed" 7"What"
label var diet "Breastfeeding status1"
label val diet diet

*diet=0: given only water (full bf)
*diet=1: given only liquids (bf & liquids)
*diet=2: given only milks (bf & milk)
*diet=3: given only solids (bf & solids)
*diet=4: given only milk and solids (bf & milk & solids)
*diet=5: not still breastfeeding (weaned)
*diet=6: not now being breastfed (m4~=95)

gen ebf=0
replace ebf=1 if diet==0

******************************************

** FEEDING
gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label val feeding feeding

*creating the predominant breastfeeding variable.
recode feeding (0 4 5=0) (1/3=1), gen(predom)

**********************************************
recode m4 (93 95=1 "Yes") (else=0 "No"), gen(ever_breastfed)
label var ever_breastfed "Ever breastfed"
label var ever_breastfed "Child ever breastfed?"
label val ever_breastfed ever_breastfed
svy: tab ever_breastfed, count format(%4.0f)
svy: tab ever_breastfed, percent format(%4.1f)

**********************************************

/** CHILD BREASTFED WITHIN ONE HOUR **/
recode m34 (0/100=1 "Yes") (else=0 "No"), gen(within_hour)
label var within_hour "Child put to breast within an hour?"
label val within_hour within_hour
svy: tab b4 within_hour, percent format(%4.1f) row

/** CHILD BREASTFED WITHIN ONE DAY **/
recode m34 (0/200=1 "Yes") (else=0 "No"), gen(within_one_day)
label var within_one_day "Child put to breast within one day?"
label val within_one_day within_one_day
svy: tab b4 within_one_day, percent format(%4.1f) row

**********************************************

*** DELIVERY
cap drop place_delivery
recode m15 (21/36=1 "Health facility") (11/12=2 "At home") ///
(else=3 "Other/Missing"), gen(place_delivery)
label var place_delivery "Place of delivery"
label val place_delivery place_delivery
svy: tab place_delivery within_one_day, percent format(%4.1f) row

** SKILLED BIRTH ATTENDANT
cap drop skilled_birth
gen skilled_birth	=	3
replace skilled_birth = 1 if (m3a==1 | m3b==1)
replace skilled_birth = 2 if m3g==1 & (m3b!=1)
replace skilled_birth = 4 if m3n==1
label define skilled_birth	1"Health professional" 2"Traditional birth attendant" ///
3"Other" 4"No one"
label var skilled_birth "Birth delivered by skilled birth attendant"
label val skilled_birth skilled_birth
*tab skilled_birth [iw=weight], m
svy: tab skilled_birth ever_breastfed, percent format(%4.1f) row

*==============================================================================*

** DROP IF NOT WITHIN SAMPLE
qui regr ever_breastfed if v208 !=0 [pw=weight]
drop if e(sample)!=1

********************************************************************************

** CHECK:

// Table 11.2 Percentage ever breastfed //

svy: tab b4 ever_breastfed, percent format(%4.1f) row
svy: tab skilled_birth ever_breastfed, percent format(%4.1f) row
svy: tab place_delivery ever_breastfed, percent format(%4.1f) row
svy: tab residence ever_breastfed, percent format(%4.1f) row
svy: tab region ever_breastfed, percent format(%4.1f) row
svy: tab education ever_breastfed, percent format(%4.1f) row
svy: tab wealth ever_breastfed, percent format(%4.1f) row

/*
svy: tab b4 ever_breastfed, count format(%4.0f)
svy: tab skilled_birth ever_breastfed, count format(%4.0f)
svy: tab place_delivery ever_breastfed, count format(%4.0f)
svy: tab residence ever_breastfed, count format(%4.0f)
svy: tab region ever_breastfed, count format(%4.0f)
svy: tab education ever_breastfed, count format(%4.0f)
svy: tab wealth ever_breastfed, count format(%4.0f)
*/

*==============================================================================*

// Table 11.2 Percentage who started breastfeeding within 1 hour of birth //

svy: tab b4 within_hour, percent format(%4.1f) row
svy: tab skilled_birth within_hour, percent format(%4.1f) row
svy: tab place_delivery within_hour, percent format(%4.1f) row
svy: tab residence within_hour, percent format(%4.1f) row
svy: tab region within_hour, percent format(%4.1f) row
svy: tab education within_hour, percent format(%4.1f) row
svy: tab wealth within_hour, percent format(%4.1f) row

/*
svy: tab b4 within_hour, count format(%4.0f)
svy: tab skilled_birth within_hour, count format(%4.0f)
svy: tab place_delivery within_hour, count format(%4.0f)
svy: tab residence within_hour, count format(%4.0f)
svy: tab region within_hour, count format(%4.0f)
svy: tab education within_hour, count format(%4.0f)
svy: tab wealth within_hour, count format(%4.0f)
*/

*==============================================================================*

// Table 11.2 Percentage who started breastfeeding within 1 day of birth //

svy: tab b4 within_one_day, percent format(%4.1f) row
svy: tab skilled_birth within_one_day, percent format(%4.1f) row
svy: tab place_delivery within_one_day, percent format(%4.1f) row
svy: tab residence within_one_day, percent format(%4.1f) row
svy: tab region within_one_day, percent format(%4.1f) row
svy: tab education within_one_day, percent format(%4.1f) row
svy: tab wealth within_one_day, percent format(%4.1f) row

/*
svy: tab b4 within_one_day, count format(%4.0f)
svy: tab skilled_birth within_one_day, count format(%4.0f)
svy: tab place_delivery within_one_day, count format(%4.0f)
svy: tab residence within_one_day, count format(%4.0f)
svy: tab region within_one_day, count format(%4.0f)
svy: tab education within_one_day, count format(%4.0f)
svy: tab wealth within_one_day, count format(%4.0f)
*/

exit

```

************************************************************ ***

FOR TABLE 11.3
```clear all
set matsize 800
set maxvar 10000
set mem 1g
cd "..."
use "MWKR7HFL", clear
set more off

********************************************************************************

** WEIGHT VARIABLE
gen weight = v005/1000000

********************************************************************************

** SURVEY SET
gen psu =    v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized)
*svydes

********************************************************************************

// RENAME

rename v013 age_woman
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
*rename sdist district

////////////////////////////////////////////////////////////////////////////////

// GENERATING DEPENDENT VARIABLES

gen child_age=b19

recode child_age (0/1=1 "0-1") (2/3=2 "2-3") (4/5=3 "4-5") (6/8=4 "6-8") ///
(9/11=5 "9-11") (12/17=6 "12-17") (18/23=7 "18-23") (else=.), gen(child_age_grp)
svy: tab child_age_grp, count format(%4.0f)

*keep if child_age_grp !=.

* keep only children less than 2 years
keep if child_age<24
keep if b9==0

* finding the youngest child living with the mother for each mother
bysort v001 v002 v003: egen minbidx=min(bidx)

* need to drop those that are bidx==2 and minbidx==1
drop if bidx>minbidx
/*keep if bidx <= minbidx*/

gen water=0
gen liquids=0
gen milk=0
gen solids=0
gen breast=0
gen bottle=0

*TO DETERMINE IF CHILD IS GIVEN WATER, SUGAR WATER, JUICE, TEA OR OTHER.
replace water=1 if (v409>=1 & v409<=7)

* IF GIVEN OTHER LIQUIDS
foreach xvar of varlist v409a v410 v410*  v413* {
replace liquids=1 if `xvar'>=1 & `xvar'<=7
}
*
cap replace liquids=1 if v412c>=1 & v412c<=7

* IF GIVEN POWDER/TINNED milk, FORMULA OR FRESH milk
foreach xvar of varlist v411 v411a v412 v414p {
replace milk=1 if `xvar'>=1 & `xvar'<=7
}
*

* IF STILL BREASTFEEDING
replace breast=1 if m4==95

* IF WAS EVER BOTTLE FED
replace bottle=1 if m38==1

gen bottle2=0
replace bottle2 = 1 if m38==1 & inrange(m4,93,99)
replace bottle2 = 0 if (m38==0 & m38==9) & inrange(m4,93,99)

*IF GIVEN ANY SOLID FOOD
foreach xvar of varlist v414* {
replace solids=1 if `xvar'>=1 & `xvar'<=7
}
*
replace solids=1 if v412a==1 | v412b==1

cap drop diet
gen diet=.
replace diet=0 if water==0 & liquids==0 & milk==0 & solids==0
replace diet=1 if water==1 & liquids==0 & milk==0 & solids==0
replace diet=2 if            liquids==1 & milk==0 & solids==0
replace diet=3 if                         milk==1 & solids==0
replace diet=4 if                         milk==0 & solids==1
replace diet=5 if                         milk==1 & solids==1
replace diet=6 if breast==0

label define diet 	0"given only water" 1"given only liquids" 2"given only milks" ///
3"given only solids" 4"given only milk and solids" 5"not still breastfeeding" ///
6"not now being breastfed" 7"What"
label var diet "Breastfeeding status1"

*diet=0: given only water (full bf)
*diet=1: given only liquids (bf & liquids)
*diet=2: given only milks (bf & milk)
*diet=3: given only solids (bf & solids)
*diet=4: given only milk and solids (bf & milk & solids)
*diet=5: not still breastfeeding (weaned)
*diet=6: not now being breastfed (m4~=95)

gen ebf=0
replace ebf=1 if diet==0

******************************************

** FEEDING
gen feeding=1
replace feeding=2 if water==1
replace feeding=3 if liquids==1
replace feeding=4 if milk==1
replace feeding=5 if solids==1
replace feeding=0 if breast==0
label define feeding 0 "Not breastfeeding" 1 "exclusive breastfeeding" 2 "+Water" 3 "+Liquids" 4 "+Other Milk" 5 "+Solids"
label val feeding feeding

*creating the predominant breastfeeding variable.
recode feeding (0 4 5=0) (1/3=1), gen(predom)
svy: tab predom if age<6, count percent format(%4.0f) col

**********************************************
/*recode m4 (93 95=1) (else=0), gen(ever_breastfed)
label var ever_breastfed "Ever breastfed"
label val ever_breastfed ever_breastfed*/

**********************************************

/** CHILD BREASTFED WITHIN ONE HOUR **/
*recode m34 (0/100=1 "Yes") (else=0 "No"), gen(within_hour)
*label var within_hour "Child put to breast within an hour?"
*label val within_hour within_hour
*svy: tab b4 within_hour, percent format(%4.1f) row

/** CHILD BREASTFED WITHIN ONE DAY **/
*recode m34 (0/200=1 "Yes") (else=0 "No"), gen(within_one_day)
*label var within_one_day "Child put to breast within one day?"
*label val within_one_day within_one_day
*svy: tab b4 within_one_day, percent format(%4.1f) row

**********************************************

*** DELIVERY
cap drop place_delivery
recode m15 (21/36=1 "Health facility") (11/12=2 "At home") ///
(else=3 "Other/Missing"), gen(place_delivery)
label var place_delivery "Place of delivery"
label val place_delivery place_delivery

** SKILLED BIRTH ATTENDANT
cap drop skilled_birth
gen skilled_birth	=	3
replace skilled_birth = 1 if (m3a==1 | m3b==1)
replace skilled_birth = 2 if m3g==1 & (m3b!=1)
replace skilled_birth = 4 if m3n==1
label define skilled_birth	1"Health professional" 2"Traditional birth attendant" ///
3"Other" 4"No one"
label var skilled_birth "Birth delivered by skilled birth attendant"
label val skilled_birth skilled_birth

*==============================================================================*

** DROP IF NOT WITHIN SAMPLE
qui regr feeding if v208 !=0 [pw=weight]
drop if e(sample)!=1

********************************************************************************

** CHECK: Table 11.3 Breastfeeding status by age as in the report
svy: tab child_age_grp feeding, count format(%4.0f)
svy: tab child_age_grp feeding, percent format(%4.1f) row

*==============================================================================*

exit

```
Re: Calculating cases for IYCF [message #14990 is a reply to message #14987] Thu, 24 May 2018 05:25
 Hassen Messages: 121Registered: April 2018 Location: Ethiopia,Africa Senior Member
I learned best Leasons from this post. Thank you all.

Hassen Ali(Chief Public Health Professional Specialist)
Re: Calculating cases for IYCF [message #14992 is a reply to message #14990] Thu, 24 May 2018 06:53
 Roselync Messages: 19Registered: December 2016 Location: Taiwan Member
Hie Mluleki Tsawe,
Thank you so much for your assistance. I will use the Syntax you have given me to try and replicate the tables. Will keep you posted on the outcome.

Regards,

Rose
 Previous Topic: Selecting one child per mother Next Topic: Postnatal care utilization variable in 2015-2016 MDHS dataset
Goto Forum:

Current Time: Tue Jun 18 20:58:46 Coordinated Universal Time 2024