I have data for each month of the year across about 2 decades, but it is currently in wide format, where the end of each variable name is YEAR_MONTH, as you can see in the example below. How can I simultaneously reshape on both month and year together, so that the final dataset ends up in month-year observations (12 rows per year, across all 20ish years).
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(STATUS_1992_01 STATUS_1992_02 STATUS_1992_03 STATUS_1992_04 STATUS_1992_05 STATUS_1992_06) int resp_id 1 1 1 -4 -4 -4 1 -4 -4 -4 -4 -4 -4 2 -4 -4 -4 -4 -4 -4 3 -4 -4 -4 -4 -4 -4 4 -4 1 1 1 1 1 5 -4 -4 -4 -4 -4 -4 6 -4 -4 -4 -4 -4 -4 7 -4 -4 -4 -4 -4 -4 8 -4 -4 -4 -4 -4 -4 9 -4 -4 -4 -4 -4 -4 10 end
Comment