The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Fertility » R Code for Calculation of Total Wanted Fertility Rate (flagging on the basis of wantedness of the child in R)
R Code for Calculation of Total Wanted Fertility Rate [message #29970] Sun, 01 September 2024 18:29 Go to next message
nima is currently offline  nima
Messages: 1
Registered: September 2024
Member
Hello, hope you're having a good day.
I have been having a hard time filtering out children in BR file on the basis of wantedness described in DHS Statistics Guide book. The book says a preceding child is considered living at the time of conception if it was born before the date of conception and a) is living at the time of the survey or b) died at or before the date of conception (calculations based on century month codes). If the resulting number is less than the ideal number of children, the birth after it is considered wanted. I have written too many codes but I have not managed to flag the children on the basis of the wantedness criterion provided by the book. It'd be really helpful if you coud provide me with an R code to calculate total wanted fertility rate.

[Updated on: Mon, 02 September 2024 16:47]

Report message to a moderator

Re: R Code for Calculation of Total Wanted Fertility Rate [message #29998 is a reply to message #29970] Mon, 09 September 2024 10:13 Go to previous message
Janet-DHS is currently offline  Janet-DHS
Messages: 888
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

You should be able to calculate wanted fertility rates in R using the GitHub code for Chapter 6 of the final report ( https://github.com/DHSProgram/DHS-Indicators-R/tree/main/Cha p06_FF). The R procedure is based on a Stata program I wrote (INTERT LINK) and you may be able to figure out the logic more easily from the comments in the Stata version. Hope this will answer your question.
Previous Topic: Desired Fertility For Men
Next Topic: Wanted Fertility Rate
Goto Forum:
  


Current Time: Sun Nov 24 13:23:52 Coordinated Universal Time 2024