Hi Charlotte,
Try this one... (This is as far as I can help)
** Matches figures on STATcompiler **
gen antibari=0 if ari==1
replace antibari=1 if ari==1 & h37f==1
replace antibari=1 if ari==1 & h37g==1
replace antibari=1 if ari==1 & h37h==1
tab antibari [iw=weight]
**************************************************
For more, try this...
**************************************************
/* NEPAL DHS 2011 */
clear all
set matsize 800
set mem 1000m
cd "..."
use "NPBR60FL", clear
set more off
********************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000
**************************
** SURVEY SET
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata)
*svydes
********************************************************************************
// RENAME
rename v013 age
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
rename sdist district
////////////////////////////////////////////////////////////////////////////////
** CHILD'S AGE **
gen child_age=v008-b3
keep if child_age <60 & child_age !=.
********************************************************************************
recode child_age (0/5=1 "<6 months") (6/11=2 "6-11 months") ///
(12/23=3 "12-23 months") (24/35=4 "24-35 months") ///
(36/47=5 "36-47 months") ///
(48/59=6 "48-59 months") (else=.), gen(child_age_grp)
********************************************************************************
** ARI **
cap drop ari
gen ari=0
replace ari=1 if h31b==1 & (h31c==1 | h31c==3)
replace ari =. if child_age>=60 | b5==0
label define ari 0"No" 1"Yes"
label var ari "Child has acute respiratory infection (ARI)"
label val ari ari
********************************************************************************
global cough "h32a h32b h32d h32e h32i h32j h32l h32r h32z"
cap drop treat_ari
gen treat_ari=0 if ari==1
label define treat_ari 0"No" 1"Yes"
label var treat_ari "Received treatment for ARI"
label val treat_ari treat_ari
* TREATMENT FOR "ARI"
foreach xvar of varlist $cough {
replace treat_ari=1 if (`xvar'==1) & ari==1
}
*
********************************************************************************
global biotica "h37f h37g h37h"
cap drop antibari
gen antibari=0 if ari==1
foreach xvar of varlist $biotica {
replace antibari=1 if (`xvar'==1) & ari==1
}
*
*==============================================================================*
** DROP IF NOT WITHIN SAMPLE
qui regr ari [pw=weight]
drop if e(sample)!=1
* Code above is the same as: keep if ari !=.
********************************************************************************
** CHECK against report**
svy: tab child_age_grp ari, count format(%4.0f) miss
svy: tab child_age_grp ari, percent format(%4.1f) row miss
***************
svy: tab child_age_grp treat_ari, count format(%4.0f)
svy: tab child_age_grp treat_ari, percent format(%4.1f) row
***************
svy: tab child_age_grp antibari, count format(%4.0f)
svy: tab child_age_grp antibari, percent format(%4.1f) row
Good luck
Mlue