Hi everyone! I have a dataset in wide for, I want to convert it into long form. Here is an example of my dataset:
----------------------- copy starting from the next line -----------------------
I need to merge this dataset with another and I want to keep hhid and mid but the problem is that if I include these variables in my "reshape long...." ,I get an error that xij variables not found. Unlike the other variables hhid and mid don't change over the year. Please tell me how I should convert my dataset and keep hhid and mid.
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long hhid byte mid int(child_mauzaid1 child_mauzaid2) byte(child_schoolid1 child_schoolid2) long(child_teachercode1 child_teachercode2) . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 62559 6 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . 1 1 1 1 10104 10103 . . . 1 . 1 . 10103 . . . 1 . 1 . 10103 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 62419 3 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 62420 7 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 1 2 2 10205 10205 . . 1 . 2 . 10205 . . . 1 1 2 2 10205 10205 . . . 1 . 2 . 10205 . . . 1 . 2 . 10205 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . end
Comment