# How To Do Multiple Linear Regression

Can you direct me to or provide an example that shows how to do a multiple linear regression analysis manually ?

I am very familiar with simple linear regression, and can perform a simple linear regression without the use of a statistics package. However I cannot do the same thing for multiple linear regression, and it is not for lack of Google searching. Most sources I have encountered end up with "And then do the multiple regression analysis in Minitab" (although it's definitely possible that some of them actually provided the method and I just didn't understand it)

In case I have the terminology wrong, when I say multiple linear regression, what I mean is 2 or more independent variables, with a single dependent variable. For instance, do a regression analysis to predict a person's heart attack risk based off their age and weight

Thank you!

• It is actually the same method for simple and multiple linear regression, the difference being that beta and X are vector & scalar (simple) or matrice and vector (multiple). So you have $\beta = (X'X)^{-1}X'Y$, $\hat Y = X\beta$, $\varepsilon = Y - \hat Y$ and $H = X(X'X)^{-1}X'$ the "hat matrix". Reference can be found here: stat.purdue.edu/~jennings/stat514/stat512notes/topic3.pdf
– Riff
Feb 20, 2017 at 7:39
• Because multiple regression can be carried out as a sequence of univariate regressions, you already have a way to do this. To be sure, such a sequence is not the most numerically stable method for large datasets--but you wouldn't be processing large amounts of data manually, anyway.
– whuber
Feb 20, 2017 at 16:04
• @Riff the pdf can now be found at stat.purdue.edu/~snandy/stat512/topic3.pdf Mar 29 at 10:54