Linear Regression Formula
Linear regression is the most basic and commonly used predictive analysis. One variable is considered to be an explanatory variable, and the other is considered to be a dependent variable. For example, a modeler might want to relate the weights of individuals to their heights using a linear regression model.
There are several linear regression analyses available to the researcher.
Simple linear regression
- One dependent variable (interval or ratio)
- One independent variable (interval or ratio or dichotomous)
Multiple linear regression
- One dependent variable (interval or ratio)
- Two or more independent variables (interval or ratio or dichotomous)
Logistic regression
- One dependent variable (binary)
- Two or more independent variable(s) (interval or ratio or dichotomous)
Ordinal regression
- One dependent variable (ordinal)
- One or more independent variable(s) (nominal or dichotomous)
Multinomial regression
- One dependent variable (nominal)
- One or more independent variable(s) (interval or ratio or dichotomous)
Discriminant analysis
- One dependent variable (nominal)
- One or more independent variable(s) (interval or ratio)
Formula for linear regression equation is given by:
\[\large y=a+bx\]
a and b are given by the following formulas:
Where,
x and y are two variables on the regression line.
b = Slope of the line.
a = y-intercept of the line.
x = Values of the first data set.
y = Values of the second data set.
Solved Examples
Question: Find linear regression equation for the following two sets of data:
 x |  2 |  4 |  6 | 8 |
y | 3 | 7 | 5 | Â 10 |
Solution:
Construct the following table:
x | y | x2 | xy |
2 | 3 | 4 | 6 |
4 | 7 | 16 | 28 |
6 | 5 | 36 | 30 |
8 | 10 | 64 | 80 |
 \(\begin{array}{l}\sum x\end{array} \) = 20 |
 \(\begin{array}{l}\sum y\end{array} \) = 25 |
 \(\begin{array}{l}\sum x^{2}\end{array} \) = 120 |
 \(\begin{array}{l}\sum xy\end{array} \) = 144 |
b = 0.95
a = 1.5
Linear regression is given by:
y = a + bx
y = 1.5 + 0.95Â x
Comments