$\newcommand{\szdp}[1]{\!\left(#1\right)}
\newcommand{\szdb}[1]{\!\left[#1\right]}$
**Problem Statement:** Show that the least squares prediction equation
$$\hat{y}=\hat\beta\_0+\hat\beta\_1x\_1+\cdots+\hat\beta\_kx\_k$$
passes through the point $(\overline{x}\_1,\overline{x}\_2,\dots,\overline{x}\_k,\overline{y}).$

Note: This is Exercise 11.81 in *Mathematical Statistics with Applications, 5th Ed.,* by Wackerly, Mendenhall, and Scheaffer.

**My Work So Far:** What we need to do is show that
$$\overline{y}=\hat\beta\_0+\hat\beta\_1\overline{x}\_1+\hat\beta\_2\overline{x}\_2
+\cdots+\hat\beta\_k\overline{x}\_k.$$
Now if we set up the matrices
\begin{align\*}
\mathbf{x}&=\szdb{
\begin{matrix}
1&x\_{11}&x\_{21}&\cdots&x\_{k1}\\
1&x\_{12}&x\_{22}&\cdots&x\_{k2}\\
\vdots &\vdots &\vdots &\ddots &\vdots\\
1&x\_{1n}&x\_{2n}&\cdots&x\_{kn}
\end{matrix}}\\
\mathbf{a}&=\szdb{
\begin{matrix}
1\\ \overline{x}\_1\\ \overline{x}\_2\\ \vdots \\ \overline{x}\_k
\end{matrix}
}\\
\mathbf{y}&=\szdb{
\begin{matrix}
y\_1\\y\_2\\ \vdots \\ y\_n
\end{matrix}},
\end{align\*}
then we know
${\hat\beta}=(\mathbf{x}^T\mathbf{x})^{-1}\mathbf{x}^T\mathbf{y},$
and we are asked to prove
$\overline{y}=\mathbf{a}^T\hat\beta.$ Here $n$ is the number of data points, and $k$ is the number of features.

**My Questions:** I have no idea where to go from here, or even whether this is the right approach to begin. What's a hint?