Hi guys,
i have a data set where one row represents one person in the survey, i.e. wide format. Now i want to change it to long format. My data set at the moment looks like this
and i would like to have it like this
ml and em refer to different labour market states while educ is time-constant education. I can cope with the reshape command when it comes to a situation where only a year variable is indicated like inc2005 inc2006 inc2007 and so on but i fail when it comes to this month-year combination.
Anyone got an idea?
Thanks
Tim
i have a data set where one row represents one person in the survey, i.e. wide format. Now i want to change it to long format. My data set at the moment looks like this
id | mljan2005 | mlfeb2005 | emjan2005 | emfeb2005 | educ |
1234 | 1 | 1 | 0 | 0 | 10 |
478 | 0 | 1 | 1 | 0 | 10 |
and i would like to have it like this
id | year | month | ml | em | educ |
1234 | 2005 | jan | 1 | 0 | 10 |
1234 | 2005 | feb | 1 | 0 | 10 |
478 | 2005 | jan | 0 | 1 | 10 |
478 | 2005 | feb | 1 | 0 | 10 |
ml and em refer to different labour market states while educ is time-constant education. I can cope with the reshape command when it comes to a situation where only a year variable is indicated like inc2005 inc2006 inc2007 and so on but i fail when it comes to this month-year combination.
Anyone got an idea?
Thanks
Tim
Comment