Matrix Tricks for Linear Statistical Models