how to generate correlation matrix with panel data?

Hello,
I have an excel data similar to:
year company Ratio1 Ratio2 Ratio3 ...
1 x a b c
2 x d e f
1 y g h j
2 y t u p
1 z ...
2 z ...
and I want to generate a correlation matrix between the ratios. But I dont know how to do it with the my dataset.
I would be glad if you can help me about this.
thank you for your answers in advance,

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 31 Oct 2019
Modifié(e) : KALYAN ACHARJYA le 31 Oct 2019
  • Read the excel file
  • Read the columns as column vectors, say col1,col2 etc
  • Here, next
result=corrcoef(col1); % so on
If pairwise
result=corrcoef(col1,col2);
More detail here

3 commentaires

e.a.
e.a. le 31 Oct 2019
Thank you for your answer Kalyan!
However, I am not sure if your approach is adequate for my data set. Because, each column of my data contains 3 different companies' ratios for the same periods. Thus, lets say for between 2014-2019 time period, time period repeated 3 times in one column for 3 companies so each row is not representing different time periods but repeating itself 3 times.
I hope I was able to express myself clearly.
I have no idea about the datasets, but you apply apply the same in section of the column vector right? .
e.a.
e.a. le 31 Oct 2019
I couldnot understand your question but in one column I enter the datas(ratios) for the time period of 2014-2019 for 3 companies.

Connectez-vous pour commenter.

Question posée :

le 31 Oct 2019

Commenté :

le 31 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by