Matrix Multiplication X'X In my econometrics textbook, the author states this result. 

He assumes only that X is an n x K matrix. He states xi is the ith column vector of matrix X. But that implies xi has dimensions n x 1, so xixi' is an n x n matrix, so a sum of n x n matrices is also an n x n matrix. But X'X has dimensions K x K.
Can someone please explain what I'm missing?
 A: Everything is correct. $X'$ is a $K\times n$ matrix so $X'X$ is a $K \times K$ matrix. The thing is that finding $X'X$ is essentially multiplying the corresponding columns of $X$ which we have $K$ of them with one another thus we have a $K\times K$ matrix as the product.
A: Since $\mathbf x_i$ is a column vector of $\mathbf X$, we should have
$$\mathbf{X'X}=[\mathbf x_1, \cdots,\mathbf x_n]'[\mathbf x_1, \cdots,\mathbf x_n]=\begin{bmatrix}\mathbf x_1'\\ \vdots \\ \mathbf x_n'\end{bmatrix}[\mathbf x_1, \cdots,\mathbf x_n]=(\mathbf x_i'\mathbf x_j)_{n\times n}$$
which is not the sum of $\mathbf x_i\mathbf x_i'$ which should be $\mathbf X\mathbf X'$ instead.
A: I found the answer in a footnote in a different chapter of the textbook: xj is a column vector corresponding to the jth column of X, but xi is a column vector that is the transpose of the ith row vector of X. So, xi' is actually the ith row vector of X. Not sure why this is the case, but hope that clarifies it for anyone else reading this.
