I do not understand why the following equality holds (taken from Cameron & Trivedi 2005: Microeconomtrics):
$\hat{\underline{\beta}}_{OLS}=(\textbf{X}'\textbf{X})^{-1}\textbf{X}'\textbf{y}=(\sum_{i=1}^{n}\textbf{x}_i\textbf{x}_{i}^{'})^{-1}\sum_{i=1}^{n}\textbf{x}_iy_i$
The notation is
$ \textbf{x}_{i}^{'} =(x_{i1},...,x_{ik})$
where $i$ designates the different observations of $k$ variables and $\textbf{X}$ stacks these upon another.
I have tried to develop the RHS of the equality, but I keep ending up with a scalar instead of a vector of coefficients.
Any help would be greatly appreciated!