The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Other countries » Namibia 2013
Re: Namibia 2013 [message #3835 is a reply to message #3805] Sat, 21 February 2015 13:11 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
The key variable you need to use is sh336k which holds the blood glucose level. The missing values come for a number of reasons:
1) Blood glucose is only collected in a subsample of households. All members in households not selected for the sample will have a missing value.
2) Blood glucose is only collected for women and men age 35-64. All members other than those age 35-64 will have a missing value.
3) Blood glucose is only collected for women and men age 35-64 who consent to being tested. All other will have missing data.

The values in sh336k are recoded into the 4 groups presented in the tables. sh336k contains values per decilitre (dl) rather than per litre as shown in the table, so the recoding is into the following groups: 0-38 = below normal, 39-60 = normal, 61-69 = prediabetic, 70-222 = elevated, other higher values are consider invalid as are excluded.

Below is some simple code in R for tabulating the data:
install.packages("foreign")
install.packages("survey")
install.packages("car")
library(foreign)
library(survey) 
library(car)

dta <- read.dta("C:/Data/DHS_stata/NMPR60FL.dta", convert.factors = FALSE)

dta$bg<-factor(recode(dta$sh336k,"0:38='1 below normal';39:60='2 normal';61:69='3 prediabetic';70:222='4 elevated';else=NA"))
dta$sex <-factor(recode(dta$hv104,"1='1 Male';2='2 Female';else=NA"))

DHSdesign<-svydesign(id=dta$hv021, strata=dta$hv022, weights=dta$hv005/1000000, data=dta)
bg.table <- svytable(~sex+bg, DHSdesign)
bg.table
prop.table(bg.table,1)*100
margin.table(bg.table,1)

The output results should look like:
> bg.table
          bg
sex        1 below normal   2 normal 3 prediabetic 4 elevated
  1 Male        111.24863  967.97756      76.83102   65.28731
  2 Female       79.05747 1570.28125     133.86968   89.82786
> prop.table(bg.table,1)*100
          bg
sex        1 below normal  2 normal 3 prediabetic 4 elevated
  1 Male         9.108702 79.255078      6.290692   5.345528
  2 Female       4.220819 83.836137      7.147202   4.795842
> margin.table(bg.table,1)
sex
  1 Male 2 Female 
1221.345 1873.036 

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DR-Congo
Next Topic: Burundi 2010 - HIV knowledge questions in male but not individual dataset (couples instead)
Goto Forum:
  


Current Time: Sat Oct 12 01:17:56 Coordinated Universal Time 2024