|
|
|
Re: Calculating cases for IYCF [message #15045 is a reply to message #15044] |
Mon, 28 May 2018 04:44 |
Mlue
Messages: 92 Registered: February 2017 Location: North West
|
Senior Member |
|
|
Hi,
See the following:
For Stata
/*
USE THE CHILDREN'S RECODE: MWKR7HFL
Malawi: Standard DHS, 2015-16
*/
clear all
set matsize 800
set maxvar 10000
set mem 1g
cd "..."
use "MWKR7HFL", clear
set more off
********************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000
********************************************************************************
** SURVEY SET
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized)
********************************************************************************
// RENAME
rename v013 age_woman
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
////////////////////////////////////////////////////////////////////////////////
// GENERATING DEPENDENT VARIABLES
gen child_age=b19
recode child_age (0/1=1 "0-1") (2/3=2 "2-3") (4/5=3 "4-5") (6/8=4 "6-8") ///
(9/11=5 "9-11") (12/17=6 "12-17") (18/23=7 "18-23") (else=.), gen(child_age_grp)
svy: tab child_age_grp, count format(%4.0f)
*keep if child_age_grp !=.
* keep only children less than 2 years
keep if child_age<24 & b5==1
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
* IF WAS EVER BOTTLE FED
gen bottle=0
replace bottle=1 if m38==1
label define bottle 0"No" 1"Yes"
label var bottle "Percentage using a bottle with a nipple?."
label val bottle bottle
gen bottle2=0
replace bottle2 = 1 if m38==1 & inrange(m4,93,99)
replace bottle2 = 0 if (m38==0 & m38==9) & inrange(m4,93,99)
label define bottle2 0"No" 1"Yes"
label var bottle2 "Percentage using a bottle with a nipple?"
label val bottle2 bottle2
**********************************************
*** DELIVERY
cap drop place_delivery
recode m15 (21/36=1 "Health facility") (11/12=2 "At home") ///
(else=3 "Other/Missing"), gen(place_delivery)
label var place_delivery "Place of delivery"
label val place_delivery place_delivery
** SKILLED BIRTH ATTENDANT
cap drop skilled_birth
gen skilled_birth = 3
replace skilled_birth = 1 if (m3a==1 | m3b==1)
replace skilled_birth = 2 if m3g==1 & (m3b!=1)
replace skilled_birth = 4 if m3n==1
label define skilled_birth 1"Health professional" 2"Traditional birth attendant" ///
3"Other" 4"No one"
label var skilled_birth "Birth delivered by skilled birth attendant"
label val skilled_birth skilled_birth
*==============================================================================*
** DROP IF NOT WITHIN SAMPLE
qui regr bottle if v208 !=0 [pw=weight]
drop if e(sample)!=1
********************************************************************************
** CHECK: Table 11.3 Percentage using a bottle with a nipple as on the report
svy: tab child_age_grp bottle, count format(%4.0f)
svy: tab child_age_grp bottle, percent format(%4.1f) row
*==============================================================================*
exit
************************************************************ ********************
For SPSS
GET
STATA FILE='...\MWKR7HFL.DTA'.
DATASET NAME DataSet2 WINDOW=FRONT.
****************************************************************************************************************************************************.
COMPUTE weight = v005/1000000.
COMPUTE strata = v023.
COMPUTE psu = v021.
WEIGHT BY weight.
***++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++***.
COMPUTE child_age = b19.
SELECT IF child_age <24 AND B5=1.
RECODE child_age (0,1 = 1) (2,3 = 2) (4,5=3) (6,7,8=4) (9 thru 11 = 5) (12 thru 17=6)
(18 thru 23=7) INTO child_age_grp.
VARIABLE LABELS child_age_grpge "Age of child in months".
VALUE LABELS child_age_grp 1"0-1" 2"2-3" 3"4-5" 4"6-8" 5"9-11" 6"12-17" 7"18-23".
****************************************************************************************************************************************************.
/** IF CHILD WAS EVER BOTTLE FED **/.
COMPUTE bottle = 0.
IF M38=1 bottle = 1.
EXECUTE.
VALUE LABELS bottle 0 "No" 1 "Yes".
VARIABLE LABELS bottle "Percentage using a bottle with a nipple?".
/** DELIVERY CARE **/.
RECODE M15 (21 THRU 36=1) (11 THRU 12=2) (ELSE=3) INTO place_delivery.
VALUE LABELS place_delivery 1 "Health facility" 2 "At home" 3 "Other/Missing".
VARIABLE LABELS place_delivery "Place of delivery".
/** SKILLED BIRTH ATTENDANT **/.
COMPUTE skilled_birth=3.
IF m3a=1 OR m3b=1 skilled_birth=1.
IF m3g=1 AND m3b NE 1 skilled_birth=2.
IF m3n=1 skilled_birth=4.
VALUE LABELS skilled_birth 1 "Health professional" 2 "Traditional birth attendant" 3 "Other" 4 "No one".
VARIABLE LABELS skilled_birth "Type of attendant at birth".
// CHECK //.
* Analysis Preparation Wizard.
CSPLAN ANALYSIS
/PLAN FILE='...\Malawi.csaplan'
/PLANVARS ANALYSISWEIGHT=weight
/SRSESTIMATOR TYPE=WOR
/PRINT PLAN
/DESIGN STRATA=strata CLUSTER=psu
/ESTIMATOR TYPE=WR.
*********************************************************.
* Complex Samples Crosstabs.
CSTABULATE
/PLAN FILE='...\Malawi.csaplan'
/TABLES VARIABLES=child_age_grp BY bottle
/CELLS POPSIZE
/STATISTICS SE
/MISSING SCOPE=TABLE CLASSMISSING=EXCLUDE.
*********************************************************.
CROSSTABS
/TABLES=child_age_grp BY bottle
/FORMAT=AVALUE TABLES
/CELLS=ROW
/COUNT ROUND CELL.
/*
CROSSTABS
/TABLES=child_age_grp BY bottle
/FORMAT=AVALUE TABLES
/CELLS=COUNT
/COUNT ROUND CELL.
/*
FREQUENCIES VARIABLES=bottle place_delivery skilled_birth child_age_grp child_age
/ORDER=ANALYSIS.
************************************************************ ********************
For SAS
/*
IMPORT THE CHILDREN'S RECODE (Stata file): MWKR7HFL
Malawi: Standard DHS, 2015-16
*/
PROC IMPORT DATAFILE="...\MWKR7HFL"
DBMS=DTA
OUT=WORK.MALAWI_DHS_15
REPLACE;
RUN;
DATA BOTTLE_FEEDING;
SET WORK.MALAWI_DHS_15;
weight = (v005/1000000);
strata = v023;
psu = v021;
child_age = b19;
IF child_age <24 & b5=1;
FORMAT BOTTLE $6. place_delivery $17. skilled_birth $30.;
/** CHILD AGE GROUPS IN MONTHS **/
IF child_age in(0:1) THEN child_age_grp = "00-01";
IF child_age in(2:3) THEN child_age_grp = "02-03";
IF child_age in(4:5) THEN child_age_grp = "04-05";
IF child_age in(6:8) THEN child_age_grp = "06-08";
IF child_age in(9:11) THEN child_age_grp = "09-11";
IF child_age in(12:17) THEN child_age_grp = "12-17";
IF child_age in(18:23) THEN child_age_grp = "18-23";
*IF child_age not in(0:23) THEN child_age_grp = .;
LABEL child_age_grp = "Age group of child in months";
/** IF CHILD WAS EVER BOTTLE FED **/
IF m38 in(1) THEN bottle="1. Yes";
IF m38 not in(1) THEN bottle="0. No";
LABEL bottle = "Percentage using a bottle with a nipple?";
/** DELIVERY CARE **/
IF M15 in(21:36) THEN place_delivery="1. Health facility";
IF M15 in(11:12) THEN place_delivery="2. At home";
IF M15 not in(11:12,21:36) THEN place_delivery="3. Other/Missing";
LABEL place_delivery = "Place of delivery";
/** SKILLED BIRTH ATTENDANT **/
*IF m3a = 1 OR m3b = 1 = 1 THEN skilled = 1; *else
*IF m3a OR m3b NE 1 THEN skilled = 0;
skilled_birth1=3;
IF m3a=1 OR m3b=1 THEN skilled_birth1=1;
IF m3g=1 AND m3b NE 1 THEN skilled_birth1=2;
IF m3n=1 THEN skilled_birth1=4;
IF skilled_birth1=1 THEN skilled_birth="1. Health professional";
IF skilled_birth1=2 THEN skilled_birth="2. Traditional birth attendant";
IF skilled_birth1=3 THEN skilled_birth="3. Other";
IF skilled_birth1=4 THEN skilled_birth="4. No one";
LABEL skilled_birth = "Type of attendant at birth";
PROC TEMPLATE;
EDIT BASE.FREQ.CROSSTABFREQS;
EDIT FREQUENCY;
FORMAT=BEST12.;
END;
END;
RUN;
PROC FREQ DATA=WORK.BOTTLE_FEEDING;
WEIGHT weight;
*TABLE bottle place_delivery skilled_birth1 skilled_birth;
TABLE child_age_grp * bottle /NOCOL NOROW NOPERCENT;
RUN;
|
|
|
|
|
Re: Calculating cases for IYCF [message #15172 is a reply to message #15124] |
Wed, 13 June 2018 02:50 |
Hope
Messages: 9 Registered: April 2018
|
Member |
|
|
Hello,
I am trying to replicate Table 11.3 in the Rwanda DHS 2014-2015. I have followed the SPSS syntax given in this thread, however, I did not get the exact result like in the report. Some percentages differ.
When I look at my output table (attached here), I realized I do not have the first column of 'not breastfeeding' as in the report. I know that first column includes missing values also, can you please help me to know where I am getting it wrong? And also how do I take into account missing values in the SPSS syntax?
Thanks,
Hope
|
|
|
|
Re: Calculating cases for IYCF [message #15230 is a reply to message #15198] |
Mon, 18 June 2018 12:25 |
Hope
Messages: 9 Registered: April 2018
|
Member |
|
|
Dear Bridgette & Ladys,
Thank you so much for your feedback.
I see I didn't know I should pay attention to the MIDX variable.
I am going to follow the steps and I will let you know if I come up with the correct results.
Thanks,
Hope
|
|
|
Re: Calculating cases for IYCF [message #16639 is a reply to message #15230] |
Sun, 10 February 2019 10:01 |
Chris
Messages: 6 Registered: April 2018
|
Member |
|
|
Dear DHS team,
I am working on the 20152016 Malawi Demographic and Health Survey dataset using SPSS. I would like to estimate the percentage of women who received a postnatal check during the first 2 days after birth (among women aged 15-49 who gave birth in the 2 years before the survey).
I have selected (b19 < 24) to restrict my analysis to women who gave birth in the last two years before the survey but my results didn't match those that are in the 2015-2016 report. I found that 43.4% of women who gave birth in the last two years had a postnatal check during the first 2 days instead of 42.4% which is in the report. Is it that the figure in the report is not correct or my calculations are wrong?
Please also help me on how to manage missing values in this variable? I am trying to replicate the results on column 10 in the table 9.9 in the report.
Any suggestions will be greatly appreciated. Thank you
|
|
|