The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Unmet Need » matching unmet need in surveys to stata code (unmet need doesn't match stata code)
matching unmet need in surveys to stata code [message #18065] Wed, 04 September 2019 12:44 Go to next message
erica.rettig is currently offline  erica.rettig
Messages: 5
Registered: September 2019
Member
Hello,

I am working with a number of surveys and am currently working on duplicating the unmet need calculations using the provided stata code at https://dhsprogram.com/topics/Unmet-Need.cfm.

From my investigation, it appears that some DHS recode versions 6 and 7 seem to use different code than provided at the above link. It's clear, given the different category names, as well as differences in the numbers for infecund/menopasual and not sexually active numbers, that the provided stata file is not what was used to calculate these numbers (see attached photo for example; this is Zimbabwe 2015 data but there are a large number of surveys with the same problem).

/index.php?t=getfile&id=1466&private=0


Is there updated code that I could use to duplicate these calculations?
Re: matching unmet need in surveys to stata code [message #18066 is a reply to message #18065] Wed, 04 September 2019 13:24 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
Yes, using the code versus using v626a does show some differences, but the differences are not in unmet need. You will see that for all of the unmet need related categories the frequencies are the same (the categories 'unmet need for spacing' to 'no unmet need' are identical). The difference is purely in the categories of women who are not considered, and how those who never had sex, are not sexually active, or are infecund or menopausal are treated. Basically it is the order in which the categorization of those women is applied that shows the difference as women could be in more than one of those groups.

If you restrict your analysis to currently married women (v502==1), you will find no differences, however if you include all women you will see differences in some categories, but not in the unmet need categories.
Re: matching unmet need in surveys to stata code [message #18069 is a reply to message #18066] Wed, 04 September 2019 13:53 Go to previous messageGo to next message
erica.rettig is currently offline  erica.rettig
Messages: 5
Registered: September 2019
Member
Hi Trevor,

Thank you for the response. I am trying to look at all women, so restricting it to married women doesn't actually solve my problem. I am also trying to convert the code to R code, so it is important to have the correct code initially so that I know any differences are due to my bugs and not issues with the provided code.

Re: matching unmet need in surveys to stata code [message #18070 is a reply to message #18065] Wed, 04 September 2019 14:54 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
The Stata code is the correct code. Some of the recode files were constructed before final decisions were made on the coding, but they don't affect unmet need calculations anyway.
Re: matching unmet need in surveys to stata code [message #18071 is a reply to message #18065] Wed, 04 September 2019 15:49 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User, a response from senior analyst Dr. Shireen Assaf:

"Dear user,
Please refer to the DHS GitHub website for Stata code on unmet need: https://github.com/DHSProgram/DHS-Indicators-Stata
This is found in Chapter 7 in the FP_NEED.do file. It is also described in the Guide to DHS Statistics : https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Need_and_Demand_for_Family_Planning.htm
Thank you.
Best regards,
Shireen Assaf
The DHS Program"
Re: matching unmet need in surveys to stata code [message #18084 is a reply to message #18071] Tue, 10 September 2019 12:07 Go to previous messageGo to next message
erica.rettig is currently offline  erica.rettig
Messages: 5
Registered: September 2019
Member
Hello,

Thank you for the quick responses. However, I am still finding inconsistencies that are affecting the results. In the provided stata code, marriage status is checked between groups 2 and 3 (and then infecundity checks overwrite this, meaning that unmarried fecund women in groups 1 and 2 are included in the calculations). This is somewhat confusing, as it appears to be against the Bradley et al whitepaper, but I am assuming the code is correct over the whitepaper?

However, there are cases where it appears that marriage checks were performed before group 2 was calculated. For example, in RW6, there are 92 cases of unmarried women where the published v626a calculation is "not married and no sex in 30 days" and the unmet need calc using the provided stata code is "no unmet need". This also happens in 78 women in UG6. The list of RW6 mismatches is attached.

I want to confirm that the calculation of marriage should be done between groups 2 and 3 as per the stata code and that the published cases (and whitepaper charts) are incorrect.

[Updated on: Tue, 10 September 2019 12:09]

Report message to a moderator

Re: matching unmet need in surveys to stata code [message #18088 is a reply to message #18084] Wed, 11 September 2019 15:49 Go to previous messageGo to next message
erica.rettig is currently offline  erica.rettig
Messages: 5
Registered: September 2019
Member
I have found a number of additional calculations that affect the outcome that I have verified are different in v626a vs the provided stata code (I am only looking at Africa, so of course there could be more outside of Africa):

v626a = infecund/menopausal, unmet= unmet need for limiting, cases:
CM6 GA6 RW6 SN6 UG6 ZW6 
 16  11   4   1   6   6 

v626a = not married and no sex in last 30 days, unmet = unmet need for limiting, cases:
RW6 UG6 
 59  35 

v626a = infecund, menopausal, unmet = unmet need for spacing, cases:
BF6 CM6 ET6 GA6 RW6 SN6 UG6 ZW6 
  3  11   1  12   1   3   1   2 

v626a = not married and no sex in last 30 days, unmet = unmet need for spacing, cases:
RW6 UG6 
151 122 



If you could advise me on these as well, it would be greatly appreciated! Thanks in advance.
Re: matching unmet need in surveys to stata code [message #18484 is a reply to message #18071] Wed, 04 December 2019 06:36 Go to previous messageGo to next message
dasanchezp is currently offline  dasanchezp
Messages: 11
Registered: February 2017
Location: San Sebastian
Member
Dear Liz,

Do you have the code but for R?

Thanks in advance.


Best regards,

David A. Sanchez P.
Re: matching unmet need in surveys to stata code [message #22081 is a reply to message #18069] Fri, 29 January 2021 00:00 Go to previous message
erica.rettig is currently offline  erica.rettig
Messages: 5
Registered: September 2019
Member
I never did find a solution but I reimplemented the correct code in R. Happy to pass it along or answer questions. I've done extensive work on it at this point.

ERettig .at. UCDavis.edu is my email (fix the at symbol to get the right address of course).
Previous Topic: Total Number of sample for Unmet need among married or in-union women as per definition 3
Next Topic: Stata Do files of total unmet need Original definition for married women
Goto Forum:
  


Current Time: Tue Dec 3 12:39:41 Coordinated Universal Time 2024