I have these four variables:
Class1
Class2
Class3
Class4
Each of them is a matrix.
They are inside a matrix X.
X = [[Class1]' [Class2]' [Class3]' [Class4]']
I apply a corrcoef function to X.
B = corrcoef(X)
to obtain the result:
B = 1.0000 -0.2392 0.9533 0.6903
-0.2392 1.0000 -0.1272 0.4267
0.9533 -0.1272 1.0000 0.6971
0.6903 0.4267 0.6971 1.0000
But I don’t know what this means. How can I interpret these values and what do they mean?
I can’t find help in MATLAB’s help documentation.
If you know the definition of a sample correlation coefficient then the answer is simple.
Since
Bis 4 by 4, I think I can safely assume thatClasszis a row vector of observations on some random variable, and that you have 4 such row vectors. Thus X is a N by 4 matrix, with columns corresponding to random variables 1 to 4, and rows corresponding to observations on the random variables.If you check the documentation in the link provided by Mark Elliot, you’ll note that this implies that
Xhas the correct orientation for applying thecorrcoeffunction.The output of
corrcoefis the sample correlation matrix. It is 4 by 4 since you have 4 random variables (columns ofX) to start with. The diagonals of this matrix correspond to each random variables correlation with itself (hence they’re all equal to 1). The off-diagonals correspond to sample correlation coefficients between the random variables. That is, the number in element (2, 3) is the sample correlation coefficient between random variable 2 and 3 (ie column 2 and 3 ofX). Since the sample correlation coefficient between 2 and 3 is the same as between 3 and 2,Bis thus symmetric by construction.Hopefully this clears it up. If the problem is that you don’t know what a correlation coefficient is, then SO is probably not the right forum. Maybe do some research of your own and then if you still have a question post it to Math Exchange.