The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » Creating an unbalanced panel
Creating an unbalanced panel [message #18416] Tue, 26 November 2019 09:35 Go to next message
Niranjana is currently offline  Niranjana
Messages: 6
Registered: October 2019
Member
Hi,

I am working with the Individual modules of NFHS I-IV. I want to create an unbalanced panel where the woman enters the panel at the time of her marriage and exits at the time of interview also containing birth history data among other variables. Basically, I want the following

indvID Year Ageatbirth Child_id Date of Birth Birth_order
1 1981 25 1 4/3/1981 1
1 1983 27 2 12/15/1983 2
1 1985 29 3 11/1/1985 3
2 1980 22 1 1/1/1980 1
2 1984 26 2 3/1/1984 2


Do I simply reshape the data to get the result? Thanks!
Re: Creating an unbalanced panel [message #18509 is a reply to message #18416] Wed, 11 December 2019 09:55 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1712
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

I don't understand why you would want to reshape the data. The information you want is on each woman's record in the IR file. If you want to apply survival methods, for example, you have everything you need--the date of birth, date of marriage, date of each birth (including birth order) and date of interview, on the woman's record.

Re: Creating an unbalanced panel [message #18512 is a reply to message #18509] Wed, 11 December 2019 10:12 Go to previous message
Niranjana is currently offline  Niranjana
Messages: 6
Registered: October 2019
Member
Thank you Tom and Bridgette.

I know that IR file contains all necessary information.

This is the code I used:



gen id =_n
sort v007 caseid
by year caseid: gen newid = 1 if _n==1
replace newid = sum(newid)
replace newid = . if missing(caseid)


duplicates report newid
rename b*_0* b*_*
keep caseid-v458
reshape long bidx_ bord_ b0_ b1_ b2_ b3_ b4_ b5_ b6_ b7_ b8_  b10_ b11_ b12_ b13_ b15_ b16_, i(newid) j(bindex)
drop if bidx==.

I was able to create a panel to analyse the impact of historical policies. Would this be right?
Previous Topic: Appending multiple waves of the NFHS annd PSU codes
Goto Forum:
  


Current Time: Thu Dec 12 20:12:29 Eastern Standard Time 2019