I'm matching the numbers from the report with the following code:
library(foreign)
library(survey)
# switch to directory where my data exists
setwd("C:/Data/DHS_stata/")
# read the PR dataset
data <- read.dta("BUPR61FL.dta", convert.factors = TRUE)
# subset for children measured with valid measures who are de facto
data2 <- data[!is.na(data$hc70) & data$hc70<9000 & data$hv103==1,]
# making a variable for stunting
data2$stunt <- ifelse(data2$hc70 < -200,'stunted','not_stunted')
# create weight variable
data2$wt <- data2$hv005/1000000
# survey settings
data.w <- svydesign(id = ~ hv001, data = data2, weight = ~ wt, strata = ~ hv022)
# tabulate stunting by sex
svyby(~stunt, ~hv104, data.w, svymean)
hv104 stuntnot_stunted stuntstunted se.stuntnot_stunted se.stuntstunted
male male 0.3790181 0.6209819 0.01352742 0.01352742
female female 0.4687265 0.5312735 0.01374611 0.01374611