The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » KDHS 2022: Table 2.17 Food security status
Re: KDHS 2022: Table 2.17 Food security status [message #28250 is a reply to message #28248] Wed, 06 December 2023 01:18 Go to previous messageGo to previous message
sokiya is currently offline  sokiya
Messages: 79
Registered: May 2017
Location: Nairobi
Senior Member
For anyone interested in reproducing the table with Stata, the code below does it

use "KEHR8AFL.dta", clear
desc sh148ca sh148cb sh148cc sh148cd sh148ce sh148cf sh148cg sh148ch sh148ci sh148cj sh148ck sh148cl sh148cm sh148cn sh148co sh148cp

gen g1 = (sh148ca + sh148cb) // Cereals and roots
gen g2 = sh148cc // Pulses, nuts 
gen g3 = (sh148cd + sh148ce + sh148cf) // Vegetables
gen g4 = (sh148cg + sh148ch) // Fruits
gen g5 = (sh148ci + sh148cj + sh148ck + sh148cl) // mMats
gen g6 = sh148cm // Milk
gen g7 = sh148co // Sugar
gen g8 = sh148cp // Oils

forvalues i=1/8 {
	replace g`i' = 7 if g`i' > 7 & g`i' < .
}

gen FCS = (g1*2) + (g2*3) + (g3*1) + (g4*1) + (g5*4) + (g6*4) + (g7*0.5) + (g8*0.5)
label var FCS "Food Consumption Score"
recode FCS (0/21 = 1 "Poor") (22/35 = 2 "Borderline") (nonmissing = 3 "Acceptable") (missing=.), gen(FCG_Groups)

ta FCG_Groups, m
ta FCG_Groups [iw=hv005]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: KDHS 2022: Table 11.4 Breastfeeding status according to age
Next Topic: Kenya 1998 Dataset Content Questions
Goto Forum:
  


Current Time: Sat Nov 30 18:15:11 Coordinated Universal Time 2024