# Can $x'x$ be written as correlation matrix?

$x'x=$ $$\begin{bmatrix} \sum_{i=1}^{n}(X_{1i}-\bar X_1)^2&\sum_{i=1}^{n}(X_{1i}-\bar X_1)(X_{2i}-\bar X_1)\cdots & \sum_{i=1}^{n}(X_{1i}-\bar X_1)(X_{ki}-\bar X_k) \\ \sum_{i=1}^{n}(X_{2i}-\bar X_1)(X_{1i}-\bar X_1)&\sum_{i=1}^{n}(X_{2i}-\bar X_2)^2\cdots \cdots & \sum_{i=1}^{n}(X_{2i}-\bar X_2)(X_{ki}-\bar X_k) \\ \vdots &\vdots&\vdots \\ \sum_{i=1}^{n}(X_{ki}-\bar X_k)(X_{1i}-\bar X_1)&\sum_{i=1}^{n}(X_{ki}-\bar X_k)(X_{2i}-\bar X_2)\cdots & \sum_{i=1}^{n}(X_{ki}-\bar X_k)^2 \\ \end{bmatrix}$$

how can i transform it to correlation matrix as :

$$x'x= \begin{bmatrix} 1 & r_{12}\cdots & r_{1k}\\ r_{21} & 1\cdots & r_{2k} \\ \vdots &\vdots&\vdots \\ r_{k1} & r_{k2}\cdots &1\\ \end{bmatrix}$$?

I know the elements are the numerator of correlation, i.e., $$r_{ij}=\frac{\sum_{u=1}^{n}(X_{iu}-\bar X_i)(X_{ju}-\bar X_j)}{\sqrt{\sum_{u=1}^{n}(X_{iu}-\bar X_i)^2\sum_{u=1}^{n}(X_{ju}-\bar X_j)^2}}$$ .But i can't transform it to correlation formula.

• is this homework? Check the self-stufy tag Mar 22, 2015 at 14:50

Let $p_i = [x'x]_{ii}$ be the $i$th diagonal element of $x'x$. Now define the $k\times k$ diagonal matrix $s$ so that $[s]_{ii} = 1/\sqrt{p_i}$ and all non-diagonal elements equal to zero Then I think the correlation matrix is $$r = s x'x s$$