Hello, I have been trying to obtain a covariance matrix for quite some time. The problem gets a bit more complicated, as I have the data arranged in such a way that I have 174 rows (every 29 rows represent a different company, with a total of 6 companies). I also have a column with the returns (attached image). I haven't found a direct way to obtain a covariance matrix, so I thought of transforming this dataset into 29 rows (one for each year) and 6 additional columns (for the 6 companies) with their respective returns. Then, that way, I could run a correlate v1 v2 v3 v4 v5 v6, covariance. However, I am stuck on organizing the data, as I can't make that modification either.I would appreciate it if someone could help me.
-
Login or Register
- Log in with
Comment