Linear regression 3 variables formula for slope coefficient estimates Okay so I think I found a formula for the coefficient estimates but it is not very concise. It has like 6 sum of squares but it is in a single fraction so it is calculable. I was wondering what the simplest formula would be for estimating the coefficients for a linear regression. So say you had the regression equation: $$y = b_0 + b_1 (x-\overline{x}) + b_2 (z-\overline{z}) + \epsilon$$
where $\overline{x}$ and $\overline{z}$ are averages of $x$ and $z$. So (with no use of matrices) what is the simplest formula you can get that involves the first and second sample moments of $y$, $x$ and $z$ for the coefficient estimates ($\hat{b}_1$ and $\hat{b}_2$)?
I just minimized the residual squared and used $s_{xx}$, $s_{xz}$ etc. notation to find the formulas but as I said they are not very nice.   
 A: Are these the "not very nice" formulas that you found?
(Note that $\hat{b}_1$ and $\hat{b}_2$ have the same denominator.)
$\hat{b}_1 = (s_{zz}\,s_{xy} - s_{xz}\,s_{zy})\,/\,(s_{xx}\,s_{zz} - s_{xz}^2)$
$\hat{b}_2 = (s_{xx}\,s_{zy} - s_{xz}\,s_{xy})\,/\,(s_{xx}\,s_{zz} - s_{xz}^2)$
$\hat{b}_0 = \overline{y}$
A: Consider rewriting the equation into matrix form.  To make notation simpler, I will define $x_i^*=x_i-\bar x$ and $z_i^*=z_i-\bar z$.  Now we can rewrite 
$$y_i = b_0 + b_1 (x_i-\overline{x}) + b_2 (z_i-\overline{z}) + \epsilon_i$$
as the following:
$$\mathbf{y}=\mathbf{X}\mathbf{\beta}+\mathbf{\epsilon}$$
Now to obtain coefficient estimates for $b_1$ and $b_2$ we can solve the the least square estimator
$$\hat\beta=(\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{y}$$
If it help to see, we can explicitly write the matrix equation 
$$\mathbf{y}=\mathbf{X}\mathbf{\beta}+\mathbf{\epsilon}$$
as
$$\begin{pmatrix}
y_1\\
y_2\\
\vdots\\
y_n
\end{pmatrix}=\begin{pmatrix}
1&x_1^*&z_1^*\\
1&x_2^*&z_2^*\\
\vdots&\vdots&\vdots\\
1&x_n^*&z_n^*\\
\end{pmatrix}\begin{pmatrix}
b_0\\
b_1\\
b_2
\end{pmatrix}+\begin{pmatrix}
\epsilon_1\\
\epsilon_2\\
\vdots\\
\epsilon_n\\
\end{pmatrix}$$
