The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » Making complex estimations
Re: Making complex estimations [message #24761 is a reply to message #24756] Wed, 06 July 2022 16:54 Go to previous messageGo to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 795
Registered: April 2022
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

A tab command can include "if" and "summarize" (see tabsum), although only iweights and fweights work with summarize.

If you have a variable that takes the values 0 and 1, multiply it by 100 to get a variable that takes the values 0 and 100. The mean of that variable will be a percentage. For example, say you want the percentage of urban women (v025=1) who are using modern contraception, by combinations of region (v024) age in 5-year intervals (v013). You could do this (note that the MCPR is the pct of women with v502=1 who have v313=3):

gen mcpr_01=0 if v502==1
replace mcpr_01=1 if v502==1 & v313==3
gen mcpr_100=mcpr_01*100
format *_100 %6.1f
tab v024 v013 if v025==1 [iweight=v005], summarize(mcpr_100) means noobs

This is an example of a tabulation that includes four variables. I don't have time to give an example for the specific variables you are asking about, but the pattern in this example may help.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Need help on Table 11.16 and 11.17 National Report 2019-20 India
Next Topic: Line Number in the BR file
Goto Forum:
  


Current Time: Fri Aug 9 19:44:19 Coordinated Universal Time 2024