Hey everyone,
I am new to Stata and despite intensive research in this forum I am facing an issue where I need some help.
I have a dataset with variables like state_1999 state_2001 state_2003 ... state_2019, family_id_1999 ... family_id_2019, College_1999 ... College_2019, you get the idea (total of 170+ variables).
Now I want to reshape the dataset so that I have a "year" variable and the variable "state", "family_id" and "College" (+ the others I didn't mention).
I guess the way is to reshape long. But think one problem is that I do not have a variable that uniquely specifies the observations, but tbh I am not sure.
I would be so happy If someone could give me a hint how to tackle this issue.
Best regards,
Ronny
I am new to Stata and despite intensive research in this forum I am facing an issue where I need some help.
I have a dataset with variables like state_1999 state_2001 state_2003 ... state_2019, family_id_1999 ... family_id_2019, College_1999 ... College_2019, you get the idea (total of 170+ variables).
state_1999 | state_2001 | ... | state_2019 | family_id_1999 | ... | family_id_2019 | College... |
Now I want to reshape the dataset so that I have a "year" variable and the variable "state", "family_id" and "College" (+ the others I didn't mention).
year | state | family_id | College | ... |
I guess the way is to reshape long. But think one problem is that I do not have a variable that uniquely specifies the observations, but tbh I am not sure.
I would be so happy If someone could give me a hint how to tackle this issue.
Best regards,
Ronny
Comment