$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.

  • $\begingroup$ is this homework? Check the self-stufy tag $\endgroup$
    – user603
    Commented Mar 22, 2015 at 14:50

1 Answer 1


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 $$

  • $\begingroup$ How did you find the way so quickly? $\endgroup$
    – ABC
    Commented Mar 22, 2015 at 16:08
  • 5
    $\begingroup$ @harry That's a standard result from matrix algebra. $\endgroup$ Commented Mar 22, 2015 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.