Dear all,
I am struggling with an operation of data managing.
I have a dataset with info at household level, and I would like to put in each row the information of one parent and all their children, such as:
family A, parent A, son 1, son 2, daughter 1
family A, parent B, son 1, son 2, daughter 1
Those are the data:
I tried some combination with the numerical counter, but nothing close to what I would like to obtain.
DO you have any clue?
Thanks, G.
I am struggling with an operation of data managing.
I have a dataset with info at household level, and I would like to put in each row the information of one parent and all their children, such as:
family A, parent A, son 1, son 2, daughter 1
family A, parent B, son 1, son 2, daughter 1
Those are the data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long(id_famiglia id_unico apidp) byte relazione_ioaltro int isco88 float(figlio1_status figlio1_io) 68001363 68001367 . . 111 . 0 68004083 68004087 . . 522 . 0 68006123 68006127 68006131 2 -8 . 0 68006123 68006127 68006135 9 -8 . 0 68006123 68006127 68006139 9 -8 . 0 68006123 68006131 68006127 2 . . 0 68006123 68006131 68006139 12 . . 0 68006123 68006131 68006135 12 . . 0 68006123 68006135 68006127 4 -8 -8 1 68006123 68006135 68006131 7 -8 -8 1 end label values relazione_ioaltro a_relationship_dv label def a_relationship_dv 2 "partner/cohabitee", modify label def a_relationship_dv 4 "natural son/daughter", modify label def a_relationship_dv 7 "stepson/stepdaughter", modify label def a_relationship_dv 9 "natural parent", modify label def a_relationship_dv 12 "step-parent", modify label values isco88 a_jbisco88_cc label def a_jbisco88_cc -8 "inapplicable", modify label def a_jbisco88_cc 111 "Legislators", modify label def a_jbisco88_cc 522 "Shop salespersons and demonstrators", modify
DO you have any clue?
Thanks, G.
Comment