# Computing multiple correlation coefficient between first three PCA components and an additional variable

This is follow-up from a previous question: How to separate groups using PCA?.

I have $25$ normals and $12$ patients. For each of them I have a vector representing a spectrogram (length $2000$).

So I have a matrix $Z$ of size $[25\times2000;12\times 2000]$.

I calculate:

[coeffZ, score, latent, tsquared, explained, mu]=pca(Z);


and bar(explained) shows me that the first $3$ PCs explain most of the variance.

I also have a behavioral score (from testing) for each of the subjects ($[37\times 1]$). It was suggested that I see if the first 3 PCs can predict the behavioral score using multiple correlation coefficient. Specifically this: http://en.wikipedia.org/wiki/Multiple_correlation

Does this make sense? Does anybody have an idea of how I can implement this in Matlab?

• What was the previous question. I don't understand this one. Mar 6, 2014 at 21:00
• @susan First: please add the link to your previous question. Second: this question is almost off-topic here, because you ask how to do something in a particular programming language (MATLAB). Please think how you can revise your question to make it more general and extend beyond a simple programming question. Mar 6, 2014 at 22:49
• Not sure but is it the same as regress? mathworks.com/help/stats/regress.html?searchHighlight=regress Mar 7, 2014 at 14:13
• I think it is this: mathworks.com/help/stats/… but I do not have the statistics toolbox Mar 7, 2014 at 14:18
• @susan: If you want somebody to receive your comments automatically, you should include @ username (without a space) somewhere in the comment. I noticed your comments only by chance (opened this question to check if there are new comments...). I can update my answer to address your your comments, but how did you run pca() if you don't have statistics toolbox? Mar 7, 2014 at 16:19

There is no function in MATLAB to directly compute multiple correlation coefficient. In principle, you could either use multiple regression function regress() to get $R^2$ and obtain your correlation coefficient $R$ with a square root, or canonical correlation function canoncorr(), which reduces to multiple correlation if one of the datasets consists of only single variable.