The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » Nutritional Status of Women on SPSS and Stata
Nutritional Status of Women on SPSS and Stata [message #15115] Tue, 05 June 2018 09:04 Go to next message
Mlue
Messages: 92
Registered: February 2017
Location: North West
Senior Member
Hi,

Using DHS data, you can replicate parts of the table on nutritional status of women.

I used the Individual Recode file...
Example for India DHS 2015-16 (National Family Health Survey = NFHS-4)

For Stata

/****/
clear all
set more off
set mem 1g
set matsize 800
cd "..."
use "SLIR61FL", clear

**********************************

** WEIGHT VARIABLE
gen weight = v005/1000000

********************************************************************************

** SURVEY SET
gen psu =    v021
gen strata = v023

svyset psu [pw = weight], strata(strata) vce(linearized)
*svydes

********************************************************************************

/*
		Underweight		=	Less than 18.5
		Normal			=	Between 18.5 and 24.9
		Overweight		=	Between 25.0 and 29.9
		Obese			=	Greater than or equal to 30.0
*/

gen bmi=v445/100 
gen bmic=1 if bmi<18.5
replace bmic=2 if bmi>=18.5 & bmi<25
replace bmic=3 if bmi>=25 & bmi<30
replace bmic=4 if bmi>=30 & bmi<60
label define bmic 1"Underweight" 2"Normal" 3"Overweight" 4"Obese"
label values bmic bmic
svy: tab bmic, count percent format(%4.1f) col
*tab bmic [iw=weight]

gen ht_flag=0
replace ht_flag=1 if v438>9000
gen preg_flag=0
replace preg_flag=1 if v213==1
gen months_since_last_birth=v008-b3_01
gen recent_birth_flag=0
replace recent_birth_flag=1 if months_since_last_birth <=1

*tab bmic if ht_flag==0 & preg_flag==0 & recent_birth_flag==0 [iw=weight]

********************************************************************************

** DROP IF NOT WITHIN SAMPLE
qui regr bmic if bmic !=. & ht_flag==0 & preg_flag==0 & recent_birth_flag==0 [pw=weight]		
drop if e(sample)!=1

********************************************************************************
** CHECK 

svy: tab v190 bmic, count format(%4.0f) miss
svy: tab v190 bmic, percent format(%4.1f) row miss


**********************************************

For SPSS
************************************************************ *******************************************************.
*/ OPEN DATASET /*.
GET
  STATA FILE='...\IAIR72FL.DTA'.
DATASET NAME DataSet1 WINDOW=FRONT.

*******************************************************************************************************************.

** WEIGHT VARIABLE.
COMPUTE weight = v005/1000000.

WEIGHT BY weight.

*******************************************************************************************************************.

** COMPLEX SURVEY VARIABLES.
COMPUTE psu =  v021.
COMPUTE strata = v023.

*******************************************************************************************************************.

/**.
** Underweight = Less than 18.5
** Normal = Between 18.5 and 24.9
** Overweight = Between 25.0 and 29.9
** Obese = Greater than or equal to 30.0
**/.

COMPUTE bmi=v445/100.

COMPUTE bmic=$SYSMIS.
      IF bmi LT 18.5 bmic = 1.
      IF bmi GE 18.5 & bmi LT 25 bmic = 2.
      IF bmi GE 25 & bmi LT 30 bmic = 3.
      IF bmi GE 30 & bmi LT 60 bmic = 4.
EXECUTE.
VARIABLE LABELS bmic 'Nutritional status of women'.
VALUE LABELS bmic 1"Underweight" 2"Normal" 3"Overweight" 4"Obese".

*COMPUTE bmic1=$SYSMIS.
*      IF bmi LT 18.5 bmic1 = 1.
*      IF bmi GE 18.5 & bmi LT 25 bmic1 = 2.
*      IF bmi GE 25 & bmi LT 30 bmic1 = 3.
*      IF bmi GE 30 & bmi LT 60  bmic1= 4.
*EXECUTE.

*******************************************************************************************************************.

COMPUTE ht_flag=1.
      IF v438 LT 9000 ht_flag=0.
      IF v438 GT 9000 ht_flag=1.
EXECUTE.


*******************************************************************************************************************.

COMPUTE preg_flag=1.
      IF v213 NE 1 preg_flag=0.
      IF v213=1 preg_flag=1.
EXECUTE.

COMPUTE months_since_last_birth=(v008-b3_01).
EXECUTE.

COMPUTE recent_birth_flag=0.
      IF months_since_last_birth GT 1 recent_birth_flag=0.
      IF months_since_last_birth LE 1 recent_birth_flag=1.
EXECUTE.
 
*************************.

SELECT IF ht_flag=0 & preg_flag=0 & recent_birth_flag=0 & bmic LE 4.

*******************************************************************************************************************.

** CHECK.
FREQUENCIES VARIABLES=bmic
  /ORDER=ANALYSIS.

*************************.

CROSSTABS
  /TABLES=V190 BY bmic
  /FORMAT=AVALUE TABLES
  /CELLS=COUNT
  /COUNT ROUND CELL.

*************************.

CROSSTABS
  /TABLES=V190 BY bmic
  /FORMAT=AVALUE TABLES
  /CELLS=ROW
  /COUNT ROUND CELL.

*******************************************************************************************************************.




Mluleki Tsawe
Re: Nutritional Status of Women on SPSS and Stata [message #15174 is a reply to message #15115] Wed, 13 June 2018 03:30 Go to previous message
Mayank_Ag is currently offline  Mayank_Ag
Messages: 22
Registered: May 2018
Location: Hyderabad
Member
I did a merge of KR (v001 v002 b16) and PR (hv001, hv002, hvidx) with PR as my base. I am working with DHS 15-16 for India.

I found that obs in HA40 and V445 are not matching which is not right according to other posts in the forums. I did a little digging so as to why they are not matching. All the variables containing the child and household characteristics (HW70 with HC70; HW71 with HC71 etc.) are matching. But the variables containing mother's characteristics are not matching. Further it looks like as if they have got shifted by one place. I have no idea how is that happening. After this i checked the merged file with my base files. It looks as if the problem is with the base PR file itself.

I have attached an image that can tell the whole problem. I have selected 3 variables to demonstrate the issue. But the trend is all over.

I used this same file(merged) to generate all the estimates as presented in the final table 10.1. I got them all matching except the ones that involve mother's characteristics (schooling, interview and BMI).
  • Attachment: issue.JPG
    (Size: 88.81KB, Downloaded 463 times)
Previous Topic: Mother's Nutritional Status.
Next Topic: Mother's Nutritional Status.
Goto Forum:
  


Current Time: Tue Oct 8 15:13:32 Coordinated Universal Time 2024