The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Calculation of median exclusive breastfeeding
Re: Calculation of median exclusive breastfeeding [message #12344 is a reply to message #12343] Wed, 03 May 2017 14:02 Go to previous messageGo to previous message
anarinaldi is currently offline  anarinaldi
Messages: 13
Registered: December 2016
Location: Uberlandia - Brazil
Member
Hello Voddo:


I use a publication of WHO: http://apps.who.int/iris/bitstream/10665/44306/1/97892415992 90_eng.pdf
In the Annex 5 (page 78) there is one explanation.
I wrote about this calculation in one article (in revision). In my case I calculate for exclusive breastfeeding.

For current status data, the first step was to obtain a distribution of infants by three age range (0 to 1.9 months, 2 to 3.9 months and 4 to 5.9 months). The distribution was smoothed by a moving average of three groups (previous, current and following value of the distribution) and divided by 3. The second step was to calculate the percentages of infants classified as exclusively breastfed in each age range. The third step was to calculate the median of exclusive breastfeeding by linear interpolation between the midpoint of the first age range for which the proportion falls below 50% and next youngest midpoint age range. This procedure is recommended by DHS Guidelines to calculate median for current status data, and by WHO(4). The final equation to calculate the median is described below (Figure 2). The median of exclusive breastfeeding using current status was calculated only for infants under 6 months.

I send the commands in Stata. I calculated the duration country by country. I didn't use loop, but I using the sintaxe that I use, it can be prepared.

First, it is necessary to generate a variable that indicate if each child is or not breastfed at present moment (yes=1 and no=0)
After, you generate a variable about age range (2 months of each interval) and a variable that indicates the situation of breastfeeding (yes/no) by age range
After, you need to collapse the dataset to calculate the moving average and after then the median duration.

collapse (count) BF [aw= SAMPLING], by(AGE_RANGE BF_AGE)
reshape wide BF,i(AGE_RANGE)j(BF_AGE)
egen freqtotal=rowtotal(BF_AGE0 BF_AGE1)
gen meanmovel= (freqtotal[_n-1]+freqtotal[_n]+freqtotal[_n+1])/3
replace meanmovel=(BF_AGE0+BF_AGE1) if AGE_RANGE==1
replace meanmovel=(BF_AGE0+BF_AGE1) if AGE_RANGE== (PUT THE LAST VALUE OF INTERVAL)
gen meanmovelBF= (BF_AME1[_n-1]+BF_AME1[_n]+BF_AME1[_n+1])/3
replace meanmovelBF=BF_AME1 in 1
replace meanmovelBF = BF_AME1 in 6 (PUT THE LAST VALUE OF INTERVAL)
gen freqBF=BF_AME1/meanmovelBF

After you calculate the median duration using formule available at publication of WHO (annex 5).

I don't know if the information is easy to understand.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Food Security
Next Topic: Format of Percentile and SD
Goto Forum:
  


Current Time: Sun Jul 14 13:27:08 Coordinated Universal Time 2024