I'm new to Stata, and I have a dataset of monthly stock returns over the last 10 years for a lot of companies, but all the data is stacked like:
Is there an easy way to reorder the data like:
| month1 | firm1 | return |
| month2 | firm1 | return |
| ... | ... | ... |
| month120 | firm1 | |
| month1 | firm2 | |
| ... | ||
| month120 | firm2 | |
| month1 | firm3 | |
| ... | ... | ... |
| and so on |
| date | firm1 | firm2 | ... | ... |
| month1 | return | ... | ... | ... |
| month2 | return | ... | ... | ... |
| ... | ... | ... | ... | ... |
| month120 | ... | ... | ... | ... |

Comment