Matching the total for SADHS domestic violence [message #22074] |
Thu, 28 January 2021 07:46 |
Mlue
Messages: 92 Registered: February 2017 Location: North West
|
Senior Member |
|
|
Good day,
I am trying to match the total for Table 20.1 in the SADHS report https://dhsprogram.com/pubs/pdf/FR337/FR337.pdf, but I cannot seem to get the total as is in the report. I am getting 5874 instead of 5865.
What could be causing this?
I have added an example of my Stata code below.
***********
* THE DV FILE *
cls
clear all
set matsize 800
set mem 1g
set maxvar 32767
cd "C:\Users\..."
use "ZADV71FL", clear
set more off
** ========================================================================== **
keep if v044==1
** ========================================================================== **
*REMOVE MISSING CASES FROM THE FIRST DOMESTIC VIOLENCE INDICATOR IN THE FILE
keep if d101a<.
gen in_DV=1
sort v001 v002 v003
save "ZAtemp.dta", replace
** ========================================================================== **
** ========================================================================== **
* THE IR FILE *
cls
clear all
set matsize 800
set mem 1g
set maxvar 32767
cd "C:\Users\***"
use "ZAIR71FL", clear
set more off
** ========================================================================== **
** ========================================================================== **
*remove the same missing values
keep if d101a<.
gen in_IR=1
sort v001 v002 v003
** ========================================================================== **
** ========================================================================== **
* MERGE *
merge 1:1 v001 v002 v003 using ZAtemp.dta
tab _merge
* this is to see which women are coming from each file
tab in_DV in_IR,m
** ========================================================================== **
keep if v044==1
** ========================================================================== **
** SURVEY SET
gen weight=d005/1000000
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata) singleunit(centered)
** ========================================================================== **
** PHYSICAL VIOLENCE **
//ANY PARTNER VIOLENCE
//ever
gen dv_prtnr_phy = 0 if v044==1 & v502>0
foreach x in a b c d e f g j {
replace dv_prtnr_phy = 1 if d105`x'>0 & d105`x'<=3
}
label val dv_prtnr_phy yesno
label var dv_prtnr_phy "Any physical violence by partner"
//EXPERIENCED PHYSICAL VIOLENCE BY ANY PARTNER IN THE 12 MONTHS BEFORE SURVEY
//ever
gen dv_aprtnr_phy = 0 if v044==1 & v502>0
replace dv_aprtnr_phy = 1 if (dv_prtnr_phy==1 | (d130a>0 & d130a<=3))
label val dv_aprtnr_phy yesno
label var dv_aprtnr_phy "Experienced physical violence by any partner"
** ========================================================================== **
** CHECK **
count
svy: tab v025, count format(%9.0f) miss //5874 instead of 5865
************************
svy: tab v190 dv_aprtnr_phy, count format(%9.0f) miss
svy: tab v190 dv_aprtnr_phy, percent format(%9.1f) miss row
** ========================================================================== **
exit
Dr. Tsawe
|
|
|
|