Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to math and merge data for a family from different subfiles in CHNS database?

    I'm using the CHNS(China health and nutrition survey) data to do empirical analysis. http://www.cpc.unc.edu/projects/china/data
    I need to use 5 modules: ID, matching, individual data, parents data and family data.
    1. One person is defined by three levels: commid+hhid+line,which means community id+ household id+member id, respectively, concluded in each subfile. And these subfiles also give parent and chidren information :
    • m12bith gives mother's hhid+line and child's hhid+line, gender and date of birth, but I don't know how to distinguish mother and children and how to match mother with their own children and date of birth
    • m12relatives gives a5(relationship to head of household) and whether involved investigation in survey year(1989,1991,1993,....2011)(expressed by binary variable "surveyed,1=yes,0=no" and another column is wave--survey year)
    • m12rst gives a5b(father's line number ), a5d( mother's line number), whether a child or an adult survey
    So the first question is how to match children with their own parents, how to match mother with their own children and date of birth by these subfiles
    2.
    • m12emw( ever married women survey) gives s47a(total number of children given birth to) and s47a( number of children who died)
    • m12wed gives s216&s218(child's number of brothers&sisters), s220&s222( husband's number of brothers& sisters)
    • pexa( physical exam) gives everyone's height including both adult and children.
    So the problem is how to discern the number of children each family has from these two files and those files from question1?
    And then how to merge these data in order to get a panel data which include : the member details(father, mother, children, number of children, height of each person, and data of birth) in a family and whether involved in a survey year.
    3.
    There are also education, income, subsidy information, and how to merge these with those basic information above by the key of (commid+hhid+line)?
    I don't know whether I express these questions explicitly, but I really helpless, pleading for help or at least some hint, both code in stata and threads will be really helpful for me, thanks very much!
    PS: these are the subfiles we need
    Click image for larger version

Name:	snipaste20161119_101438.png
Views:	1
Size:	42.0 KB
ID:	1364834


    Attached Files

  • #2
    [QUOTE]
    clear
    cd "..."
    use "m12birth.dta", clear
    foreach list in 12emw m12wed g pex{
    joinby commid hhid line gender using `list'.dta, unmatched(none)
    }
    [/QUOTE

    Comment

    Working...
    X