Dear community,
I have currently a list of 270 stock portfolio returns (monthly data), who are constructed by sorting on specific firm characteristics.
The sorting is done on 4 different characteristics, abbreviated by "ME", "BM", "INV", and "RMA"
The first three are sorted into 3 categories, while the fourth is sorted on 5.
The columns in my dataset are, therefore, labeled from R_ME1BM1INV1RMA1 to ME3BM3INV3RMW5
I would like to create a table with mean returns dependent on the numbers in the variable name, which looks something like this:
I assume that this specific format is not easy to accomplish, but I would be very happy to get a tip how I can make the number in the variable name determining the rows.
I did not find a similar question here on Statalist.
Thank you in advance!
I have currently a list of 270 stock portfolio returns (monthly data), who are constructed by sorting on specific firm characteristics.
The sorting is done on 4 different characteristics, abbreviated by "ME", "BM", "INV", and "RMA"
The first three are sorted into 3 categories, while the fourth is sorted on 5.
The columns in my dataset are, therefore, labeled from R_ME1BM1INV1RMA1 to ME3BM3INV3RMW5
I would like to create a table with mean returns dependent on the numbers in the variable name, which looks something like this:
ME | BM | INV | RMW-> | 1 | 2 | 3 | 4 | 5 | ||||
1 | 1 | 1 | mean(R_ME1BM1INV1RMA1) | ... | ||||||||
1 | 1 | 2 | ... | |||||||||
1 | 1 | 3 | ||||||||||
1 | 2 | 1 | ||||||||||
1 | 2 | 2 | ||||||||||
1 | 2 | 3 | ||||||||||
... |
I did not find a similar question here on Statalist.
Thank you in advance!
Comment