The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Malaria » Prevention of malaria in pregnant women with Fansidar (calculate the variable on women aged 15-49 years who had a live birth in the 2 years before the survey using TOGO malaria indicator survey 2017)
Prevention of malaria in pregnant women with Fansidar [message #23880] Tue, 28 December 2021 20:44 Go to next message
Gountante is currently offline  Gountante
Messages: 7
Registered: March 2021
Location: Anvers, Belgium
Member

Hi,
I have been trying for few days to calculate the variable on women aged 15-49 years who had a live birth in the 2 years before the survey. I use the data on malaria indicator survey in TOGO 2017. I find 1290 women but the survey report gives 1315 women. Can you help me with how to get this number of women?

Best regards
Kombate
Re: Prevention of malaria in pregnant women with Fansidar [message #23886 is a reply to message #23880] Wed, 29 December 2021 09:48 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3034
Registered: February 2013
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

The following Stata code shows one way to get the 1315 (this is a weighted frequency). There are other ways to get it, some of which would use the KR file. What I wrote is much more general, and could be used to get the number of births in any time interval.

use "...TGIR71FL.DTA" , clear

* Construct variables n1, n2, n3, n4, n5 for the number of births in the past 1, 2, 3, 4, 5 years
* Increment them by 1 for each child born within the interval according to b19

* v209            births in past year
* v238            births in last three years
* v208            births in last five years

keep v001 v002 v003 v005 v208 v209 v238 b19*

* remove the 0 in index 01 through 09
rename b19_0* b19_* 

local lnumbers 1 2 3 4 5

foreach ln of local lnumbers {
gen n`ln'=0
  local li=1
  quietly while `li'<=20 {
  replace n`ln'=n`ln'+1 if b19_`li'<12*`ln'
  local li=`li'+1
  }
tab1 n`ln'
tab1 n`ln' [iweight=v005/1000000]
}

* check agreement for pre-coded numbers of births in the past 1, 3, or 5 years
tab n1 v209
tab n3 v238
tab n5 v208

* (There is a discrepancy between n1 and v209 that I will attempt to resolve)

* The weighted number of women who Had a live birth in the past two years comes from
*  the weighted tabulation of n2: 1270.56 + 43.66 + 0.75 = 1314.97 = 1315

Re: Prevention of malaria in pregnant women with Fansidar [message #23887 is a reply to message #23886] Wed, 29 December 2021 18:15 Go to previous messageGo to next message
Gountante is currently offline  Gountante
Messages: 7
Registered: March 2021
Location: Anvers, Belgium
Member


Hi,
Thanks for the answer. I tried again with the KR file following what you suggested but I found 1394.




Re: Prevention of malaria in pregnant women with Fansidar [message #23888 is a reply to message #23886] Wed, 29 December 2021 22:04 Go to previous messageGo to next message
Gountante is currently offline  Gountante
Messages: 7
Registered: March 2021
Location: Anvers, Belgium
Member

Hi,
I started again, but still I don't find the same things as you; how did you get:
"n2: 1270.56 + 43.66 + 0.75" = 1314.97 = 1315

I tried another method, but I found 1296
gen livebaby=v008-b3_01
keep if livebaby < 24
tab livebaby [iw=v005/1000000]

My results are always different from the one obtained in the survey report.
Re: Prevention of malaria in pregnant women with Fansidar [message #23890 is a reply to message #23888] Thu, 30 December 2021 09:36 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3034
Registered: February 2013
Senior Member

Following is another response from DHS Research & Data Analysis Director, Tom Pullum:

My code was designed for the IR file. In the KR file, there is one record for each child, and the mother's data is copied onto each of them. You want to know the number of women who had a birth (i.e. at least one birth) in the past 24 months. Here is a simple way to get that:

use "...TGKR71FL.DTA" , clear
gen wt=v005/1000000
keep if b19<24
egen sequence=seq(), by(v001 v002 v003)
keep if sequence==1
total wt

This gives a weighted total of 1315, which agrees with the much more general approach that I used with the IR file.
Re: Prevention of malaria in pregnant women with Fansidar [message #23891 is a reply to message #23890] Thu, 30 December 2021 12:17 Go to previous message
Gountante is currently offline  Gountante
Messages: 7
Registered: March 2021
Location: Anvers, Belgium
Member

Dear Bridgette
Thank you a lot for the answer.

Previous Topic: Malaria in pregnancy-DHS-VI SPSS version
Next Topic: HML10
Goto Forum:
  


Current Time: Thu Apr 18 10:24:48 Coordinated Universal Time 2024