\begin{Schunk}
\begin{Sinput}
 mod1 <- lm(y ~ x1 + x2 + x3, data = any_data_you_have)
 summary(mod1)
 X <- model.matrix(mod1)
 XTX <- t(X) %*% X
 XTXinv <- solve(XTX)
 BetaHat <- XTXinv %*% t(X) %*% any_data_you_have$y
\end{Sinput}
\end{Schunk}
