Linear regression
Gist
A model to describe the linear relationship between an independent variable and a predictor. The bread butter of statistical analysis.
Mathematics
Standard
For the simplest linear regression:
where
Matrix notation
We can also present the regression in the matrix form:
Key Assumptions
-
Linearity in terms of the coefficients: so the addition of Polynomial (linear regression) terms such as
is valid for a linear regression. The effect on Y of a one unit change in X does not depend on the level of X. -
The Error term at each value of the predictor is normally distributed: though this assumption can be broken if the model is used more for prediction than inference. Check Advice - Regresion
-
The variance of the error is constant, if not than we consider the model to have Homoscedasticity-Heteroscedasticity. Though Gelman suggests it's not that big of a deal and one can also use weighted regression [1]
-
Errors are independent (i.e there's no Autocorrelation)
Parameterization
We can use the Least squares using the calculus method[2] or the linear algebra method (see the page for derivation)
Interpretation
Diagnostics
Check the Residuals