I have the following data.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int CNTRY_NAME double Lev2 float(internal_reasons immi_reasons) long pernum float(IN_work IN_family IN_educ IN_marriage IN_mwar_disaster IN_housingr IN_other imm_work imm_family) 116 116001001 1 . 26 26 . . . . . . . . 116 116001001 2 . 36 . 36 . . . . . . . 116 116001001 3 . 5 . . 5 . . . . . . 116 116001001 4 . 56 . . . 56 . . . . . 116 116001001 7 . 16 . . . . . . 16 . . 116 116001001 . 7 4 . . . . . . . . . 116 116001002 1 . 11 11 . . . . . . . . 116 116001002 2 . 12 . 12 . . . . . . . 116 116001002 3 . 2 . . 2 . . . . . . 116 116001002 4 . 13 . . . 13 . . . . . 116 116001002 7 . 12 . . . . . . 12 . . 116 116001003 1 . 254 254 . . . . . . . . 116 116001003 2 . 185 . 185 . . . . . . . 116 116001003 3 . 30 . . 30 . . . . . . 116 116001003 4 . 93 . . . 93 . . . . . 116 116001003 5 . 1 . . . . 1 . . . . 116 116001003 7 . 41 . . . . . . 41 . . 116 116001003 . 1 13 . . . . . . . 13 . 116 116001003 . 2 3 . . . . . . . . 3 116 116001003 . 7 1 . . . . . . . . . end
I am trying have all the data for variables IN_work IN_family IN_educ IN_marriage IN_mwar_disaster IN_housingr IN_other imm_work imm_family on one row for each unique Lev2 and not cascading as they appear now. Something like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int CNTRY_NAME double Lev2 float(internal_reasons immi_reasons) long pernum float(IN_work IN_family IN_educ IN_marriage IN_mwar_disaster IN_housingr IN_other imm_work imm_family) 116 116001001 1 . 26 26 36 5 56 . . . . .
How would i do this correctly?
Thank you in advance
0 Response to Help with collapsing data
Post a Comment