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)
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 previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3172
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

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


Current Time: Sat Oct 19 15:10:22 Coordinated Universal Time 2024