# Relationship between correlation matrix and R square

#### liamplayt

##### New Member
Hi there!

I wonder if R-squared can be deemed a function of the correlation matrix (or the variance-covariance matrix)?
The only ways to compute the R-squared I know are
1. the correlation coefficient between the predicted values (y_hat) and the observations (y)
2. 1 - SSE/SST

What can I do if I want to compute R-squared but have in hand only the correlation matrix and sample size?

#### Dragan

##### Super Moderator
Hi there!

I wonder if R-squared can be deemed a function of the correlation matrix (or the variance-covariance matrix)?
The only ways to compute the R-squared I know are
1. the correlation coefficient between the predicted values (y_hat) and the observations (y)
2. 1 - SSE/SST

What can I do if I want to compute R-squared but have in hand only the correlation matrix and sample size?
$$R_{Y\cdot 1,2,...,k}^{2}=r_{Y1}^{2}+r_{Y\left ( 2\cdot 1 \right )}^{2}+r_{Y\left ( 3\cdot 12 \right )}^{2}+\cdots +r_{Y\left ( k\cdot 12,...,k-1 \right )}^{2}$$