The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » Making complex estimations
Making complex estimations [message #24756] Wed, 06 July 2022 13:42 Go to next message
captain is currently offline  captain
Messages: 2
Registered: July 2022
Member
I am concerned with India 2015-16. In order to calculate the percentage of never-married women who own a mobile telephone, one may simply run "tab v501 s930" and just add up the numbers from there to get the answer. Similarly, if we are interested how the ability to visit the market alone varies by marital status, one may run "tab v501 s928a". However, once three variables are involved, tab no longer works and we have to use bigtab. Any more than three and I am lost.

I have five tasks that I would like to complete but unable to do so due to my relative Stata inexpertise and I hope an analyst can help me fulfill them by providing the relevant code:


1. Proportion of never-married women aged 20-24 who own a mobile telephone by urban/rural residence.

2. Proportion of urban never-married women aged 19-23 with an education of exactly 10 years from the states Punjab, Haryana, Rajasthan, Bihar, Uttar Pradesh who own a mobile telephone.

3. Proportions of rural never-married women aged 18-22 educated upto the 5th year from the states Punjab, Haryana, Rajasthan who own a mobile telephone sorted by their caste.

4. Proportions of rural Hindu/Sikh OBC-caste never-married women aged 18-24 educated upto the 5th year from the states Punjab, Haryana, Rajasthan who can 1) visit the market alone, 2) need someone to visit the market, 3) not allowed to visit the market.

5. Proportions of rural Hindu/Sikh never-married women aged 18-24 educated upto the 5th year from the states Punjab, Haryana, Rajasthan who can visit the market alone sorted by their caste.


[Updated on: Wed, 06 July 2022 13:47]

Report message to a moderator

Re: Making complex estimations [message #24761 is a reply to message #24756] Wed, 06 July 2022 16:54 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 888
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.
Re: Making complex estimations [message #24777 is a reply to message #24761] Sat, 09 July 2022 01:18 Go to previous messageGo to next message
captain is currently offline  captain
Messages: 2
Registered: July 2022
Member
Janet-DHS wrote on Wed, 06 July 2022 16:54
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.
Tom, thank you for your greatly informative reply and also for the illustrative example which was quite helpful. However, there is a problem. For India 2015-16's individual recode (women), the variable for mobile ownership status of the respondent is not provided although "S930" is present if you type "label list S930" which is basically the mobile ownership status but it hasn't been turned into a proper variable.

Can you help me with this? I am trying to calculate the percentage of never-married women aged 20-24 who don't own their own personal mobile by state.
Re: Making complex estimations [message #24796 is a reply to message #24777] Wed, 13 July 2022 08:53 Go to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 888
Registered: April 2022
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

Marital status is given by v501, and v501=0 is never-married. Age in 5-year intervals is v013, and v013=2 is age 20-24. It looks to me like s930 is ok, and its label is S930:

. label list S930
S930:
0 no
1 yes

I believe the easiest way to get what you want is with this command:

"tab v024 s930 if v013==2 & v501==1 [iweight=v005/1000000], row".

The first column gives the percentage of never-married women age 20-24 who do not have a cell phone, by state. Hope this works for you.
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: Mon Nov 25 08:05:00 Coordinated Universal Time 2024