The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » Identifying siblings of a child that are below 1 years of age (R) (Identifying siblings of a child that are below 1 years of age (R))
Identifying siblings of a child that are below 1 years of age (R) [message #24842] Tue, 19 July 2022 08:33 Go to next message
Nidigot is currently offline  Nidigot
Messages: 7
Registered: July 2022
Member
Dear reader,

I am in need of help with the following:

I require to (I) identify siblings that are (II) below 1 years of age, for each child (row). The constructed variable should indicate per child how many siblings below 1 year of age he/she has (0,1,2,3,etc).

What procedure/operations will work? (R script)

Thank you so much!

/N

[Updated on: Tue, 19 July 2022 08:36]

Report message to a moderator

Re: Identifying siblings of a child that are below 1 years of age (R) [message #24862 is a reply to message #24842] Thu, 21 July 2022 12:29 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 891
Registered: April 2022
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

Please do not post the same question twice--but maybe you thought the first time didn't work?

You are talking about pairs of siblings. One of them should be below age 1. What about the other one? Or should they both be below age 1? What do you mean by "0,1,2,3..."? Hardly any children age 0 have a sibling age 0, and almost all pairs of children in which BOTH are age 0 will be twins. I don't think any surveys will have enough pairs of twins age 0 for any statistical analysis. Or are you talking about a reference child of any age, paired with a sibling age 0?

We can provide Stata code to construct sibships or pairs of siblings, where siblings are defined to be children with the same mother (not necessarily the same father). Is Stata the programming language you are using?
Re: Identifying siblings of a child that are below 1 years of age (R) [message #24867 is a reply to message #24862] Fri, 22 July 2022 05:01 Go to previous messageGo to next message
Nidigot is currently offline  Nidigot
Messages: 7
Registered: July 2022
Member
Hi and thank you for your reply!

I am new here and didn't see the duplicate post after submitting. Perhaps the time had elapsed as I also got logged out.

Let me give the clarifications you're after: I would like to obtain a column/variable that indicates for that child how many siblings it has that are less than or equal to one year of age.

Let me know if I need to be any clearer,

Thank you for your help
Re: Identifying siblings of a child that are below 1 years of age (R) [message #24908 is a reply to message #24867] Mon, 01 August 2022 12:25 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 891
Registered: April 2022
Senior Member
Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

Usually we at DHS would not answer a question like this, but I have always been interested in kinship and decided to work on it.

You did not say what survey you are using. I will use the Bangladesh 2017-18 survey (BD7R) to illustrate.

Two children are siblings if they have the same mother. I will re-state your question to be as follows: "For a child age A or less, how many YOUNGER siblings do they have who are age B or less." You described this with B=0 but I am generalizing. In my example, A is 17 and B is 0, 1, 2, 3, or 4. I assume the question is about living children and siblings but that could be changed.

Usually two children the same age will be twins, but I allow for that. You have to be sure not to count a child as its own sibling. The ages of living children are b8. You have to store a temporary file.

Open the BR file (BDBR7RFL.dta) in Stata. Enter the lines pasted below. Good luck.

cd e:\DHS\DHS_data\scratch

use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\BDBR7RFL.DTA" , clear
keep if b5==1

keep v001 v002 v003 bidx b8

forvalues li=0/4{
gen nsibs_age_le_`li'=0
}

sort v001 v002 v003

save index_children.dta, replace

drop nsibs*
rename bidx bidx_sib
rename b8 b8_sib

sort v001 v002 v003
joinby v001 v002 v003 using index_children.dta

forvalues li=0/4{
replace nsibs_age_le_`li'=nsibs_age_le_`li'+1 if bidx_sib<bidx & b8_sib<=`li'
}

drop bidx_sib b8_sib

collapse (sum) nsibs_age_le_* (first) b8, by(v001 v002 v003 bidx)

forvalues li=0/4{
tab b8 nsibs_age_le_`li' if b8<=17
}
Re: Identifying siblings of a child that are below 1 years of age (R) [message #25177 is a reply to message #24908] Fri, 09 September 2022 12:59 Go to previous message
Nidigot is currently offline  Nidigot
Messages: 7
Registered: July 2022
Member
Amazing, thank you so much!
Previous Topic: NFHS -5, Table 12.10
Next Topic: Issue with importing Individual Recode datasets for India for the years 2015-2016 on R
Goto Forum:
  


Current Time: Tue Nov 26 20:47:57 Coordinated Universal Time 2024