The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Using svy: tab
Using svy: tab [message #8401] Fri, 23 October 2015 11:03 Go to next message
lexgw is currently offline  lexgw
Messages: 31
Registered: October 2015
Location: United Kingdom
Member

Dear all, I am trying to learn how to run descriptive statistics in stata in order to replicate Uganda DHS 2011 statics on women and child health. I have two questions for help;
1. There are two ways of attaching weights to the variables and then tab:

gen wgt=v005/1000000
tab v025 [iweight=wgt]

This has worked and produced an output
type of |
place of |
residence | Freq. Percent Cum.
------------+-----------------------------------
urban | 1,717.2704 19.80 19.80
rural | 6,956.7296 80.20 100.00
------------+-----------------------------------
Total | 8,673.9999 100.00

Another method (recommended in DHS videos) is set for survey data and then tab

gen wgt=v005/1000000
svyset[pw=wgt], psu(v021) strata(v022) singleunit(centered)
svy:tab v025

this has not worked
pweight: wgt
VCE: linearized
Single unit: centered
Strata 1: v022
SU 1: v021
FPC 1: <zero>

. svy:tab v025
no observations
r(2000);
What could be the problem?

2. which variables are suitable to capture child health and which data file is suitable to use to get these variables?

Gabriel
Re: Using svy: tab [message #8420 is a reply to message #8401] Mon, 26 October 2015 14:42 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
1) Neither variable v022 nor v023 have been set in the Uganda DHS 2011 dataset. In appendix A of the report it can be seen that the strata were urban and rural areas in each region, so you can set v022 and v023 as follows:

egen strata = group(v024 v025)
replace v022 = strata
replace v023 = strata

Then run the svyset and svy:tab commands to produce the results.

2) You should use the dataset that matches the unit of analysis that you wish to use. If you are looking at child health, I expect that you will want to analyze children under the age of 5, in which case you should work with the children's recode (KR) file.
Re: Using svy: tab [message #8432 is a reply to message #8420] Tue, 27 October 2015 12:18 Go to previous messageGo to next message
lexgw is currently offline  lexgw
Messages: 31
Registered: October 2015
Location: United Kingdom
Member

Thanks so much Trevor. Let me try it out..and will get back at some point.
Re: Using svy: tab [message #8518 is a reply to message #8420] Sun, 08 November 2015 16:28 Go to previous messageGo to next message
lexgw is currently offline  lexgw
Messages: 31
Registered: October 2015
Location: United Kingdom
Member

Hello,

In connection to the question I asked previously, I am able to replicate DHS 2011 statistics on child health for Uganda. But this is only when it is a one way tabulation (just one variable). When I make a two-way tabulation (with two variables) I do not replicate DHS statistics. I need help. For example, I generated an ARI variable when I tab it I get correct results but when I tab it with v024 (region), I do not get the figures in table 10.5 DHS report 2011 for Uganda page 129. This is what I get;

I generate ARI variable only for live children only (b5==1)
. gen ari=0 if b5==1
(1299 missing values generated)

. *ARI is defined as children with a cough with short rapid breaths (h31b==1) or/and congestion in the chest/blocked or runny nose
> (h31c==1 | h31c==3)*/
. replace ari=1 if b5==1 & h31b==1 & (h31c==1 | h31c==3)/*1 is for chest only 3 is for both chest & blocked nose*/
(2156 real changes made)

. svy: tab ari if survey==1
(running tabulate on estimation sample)

Number of strata = 19 Number of obs = 7355
Number of PSUs = 404 Population size = 7535.3926
Design df = 385

-----------------------
ari | proportions
----------+------------
0 | .8516
1 | .1484
|
Total | 1
-----------------------
Key: proportions = cell proportions
This seems fine because the report is talking about 15% of children with symptoms of ARI. but for the two I can replicate eg;
svy: tab v024 ari if survey==1
(running tabulate on estimation sample)

Number of strata = 19 Number of obs = 7355
Number of PSUs = 404 Population size = 7535.3926
Design df = 385

-------------------------------
| ari
region | 0 1 Total
----------+--------------------
kampala | .0533 .0086 .062
central | .0894 .0092 .0987
central | .0928 .0125 .1054
east cen | .096 .0171 .1131
eastern | .1419 .0284 .1704
north | .0691 .0196 .0887
karamoja | .0298 .0075 .0373
west-nil | .0509 .0083 .0592
western | .1211 .0244 .1454
southwes | .1072 .0127 .1199
|
Total | .8516 .1484 1
-------------------------------
Key: cell proportions

Pearson:
Uncorrected chi2(9) = 75.4301
Design-based F(7.78, 2996.03)= 3.4660 P = 0.0006

This is different from what is in table 10.5 page 129
svy: tab v106 ari if survey==1
(running tabulate on estimation sample)

Number of strata = 19 Number of obs = 7355
Number of PSUs = 404 Population size = 7535.3926
Design df = 385

-------------------------------
highest |
education | ari
al level | 0 1 Total
----------+--------------------
no educa | .1219 .0216 .1435
primary | .5357 .1002 .6359
secondar | .1627 .0222 .1849
higher | .0312 .0044 .0356
|
Total | .8516 .1484 1
-------------------------------
Key: cell proportions

Still different!! need help. thanks
Re: Using svy: tab [message #8705 is a reply to message #8401] Thu, 03 December 2015 12:55 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
You are getting cell proportions. Just add ", row" to your svy: tab commands to get row proportions
Re: Using svy: tab [message #8706 is a reply to message #8705] Thu, 03 December 2015 13:21 Go to previous message
lexgw is currently offline  lexgw
Messages: 31
Registered: October 2015
Location: United Kingdom
Member

Thanks dear Trevor for the detailed description of the procedure. Will get back any time in case... thanks


Gabriel
Previous Topic: Age in months: Missing values
Next Topic: Running a regression with the KR file
Goto Forum:
  


Current Time: Sat Oct 5 17:20:06 Coordinated Universal Time 2024