The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Nutrition and Anthropometry » incorrect stunting rates
Re: incorrect stunting rates [message #17709 is a reply to message #14275] Wed, 08 May 2019 11:31 Go to previous message
anneclaireclaire is currently offline  anneclaireclaire
Messages: 11
Registered: May 2014
Location: Italy
Member
Dear Trevor, I am trying to match the stunting numbers for the RW ( Rwanda) DHS 2014-2015 but it does not work . Can you please help me . I am using the following code
Thanks in advance
library(haven)
library(data.table)
RWPR70FL <- as.data.table(read_dta("~/Data/RW/2015_DHS/RWPR70FL.DTA", convert.factors = TRUE)))

RWPR70_2 <- RWPR70FL[!is.na(hc70) & hc70<9000 & hv103==1,]


RWPR70_2$stunt2 <- cut(RWPR70_2$hc70,
breaks=c(-Inf, -200, Inf),
labels=c("stunted","not sunted"))

RWPR70_2[,wt:= hv005/1000000]
RWPR70_2[, district:=as.factor(shdistrict)]

RWPR70.w2 <- svydesign(id = ~ hv001, data = RWPR70_2, strata = ~ hv022, weights=~wt)
svyby(~factor(stunt2), RWPR70_2$district, RWPR70.w, svymean, verbose=TRUE)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DHS of India 2015/16 and 2005/06
Next Topic: Consent for additional tests
Goto Forum:
  


Current Time: Sun Dec 22 09:07:54 Coordinated Universal Time 2024