The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » STATA code for food insecurity access scale(FIES), Anxiety(GAD-7) and Depression(PHQ-9) (How to FIEX, GAD-7, and PHQ-9 in Nepal 2022 DHS data)
Re: STATA code for food insecurity access scale(FIES), Anxiety(GAD-7) and Depression(PHQ-9) [message #28657 is a reply to message #28638] Wed, 14 February 2024 13:28 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
The recode file includes the probabilities for each case in the variables hfs_mod and hfs_sev. These variables have 8 implied decimal places, so you need to divide by 10^8, but that would provide proportions. To produce percentages as in the report, you need to multiply by 100, so in practice the values are divided by 1000000. You can use these probabilities in means to calculate the percentage of de facto households members with a moderate or severe risk of food insecurity as follows:

use "NPPR82FL.DTA"
* 8 implied decimals for hfs_mod and hfs_sev, but less 2 decimals to make it a percentage rather than a proportion - 6 zeros needed below
gen mod = hfs_mod/1000000
gen sev = hfs_sev/1000000
gen wgt = hv005/1000000 // 6 implied decimals for weight
* means 
mean mod [iw=wgt] if hv102 == 1
mean sev [iw=wgt] if hv102 == 1

This gives the following results:
. mean mod [iw=wgt] if hv102 == 1

Mean estimation                         Number of obs = 54,144

--------------------------------------------------------------
             |       Mean   Std. err.     [95% conf. interval]
-------------+------------------------------------------------
         mod |   12.48814   .1177041      12.25744    12.71884
--------------------------------------------------------------

. mean sev [iw=wgt] if hv102 == 1

Mean estimation                         Number of obs = 54,144

--------------------------------------------------------------
             |       Mean   Std. err.     [95% conf. interval]
-------------+------------------------------------------------
         sev |   1.332236   .0349331      1.263767    1.400705
--------------------------------------------------------------
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: multidimensional poverty index
Next Topic: Measles vaccination NFHS 5 India
Goto Forum:
  


Current Time: Sat Nov 9 09:11:19 Coordinated Universal Time 2024