Hi,
I have an Excel spreadsheet with "n" sheets with n=[6 12 18 .... t*6], t positive natural number. Each sheet has identical structure and variables. Each of them is basically a diagonal matrix of results (4 rows diagonal) and missing values everywhere else. I would like to reshape each spreadsheet in a way that the diagonal of results is presented in the top (4) rows. How can I do that in Stata? Once I have the solution for 1 sheet, how do I loop through each sheet in the excel file to apply the code to each sheet? I have no idea how to start coding that in Stata. I enclose the entire Excel spreadsheet, a csv file and a screenshot of what I have and what I want. Thanks a lot for your help in advance!

I have an Excel spreadsheet with "n" sheets with n=[6 12 18 .... t*6], t positive natural number. Each sheet has identical structure and variables. Each of them is basically a diagonal matrix of results (4 rows diagonal) and missing values everywhere else. I would like to reshape each spreadsheet in a way that the diagonal of results is presented in the top (4) rows. How can I do that in Stata? Once I have the solution for 1 sheet, how do I loop through each sheet in the excel file to apply the code to each sheet? I have no idea how to start coding that in Stata. I enclose the entire Excel spreadsheet, a csv file and a screenshot of what I have and what I want. Thanks a lot for your help in advance!
Comment