Mathematically, a linear regression is defined by this equation:
y = bx + a + ε
Where:
- x is an independent variable.
- y is a dependent variable.
- a is the Y-intercept, which is the expected mean value of y when all x variables are equal
to 0. On a regression graph, it's the point where the line crosses the Y axis.
- b is the slope of a regression line, which is the rate of change for y as x changes.
- ε is the random error term, which is the difference between the actual value of a
dependent variable and its predicted value.
The linear regression equation always has an error term because, in real life, predictors are never
perfectly precise. However, some programs, including Excel, do the error term calculation
behind the scenes. So, in Excel, you do linear regression using the least squares method and
seek coefficients a and b such that:
y = bx + a
For our example, the linear regression equation takes the following shape:
Umbrellas sold = b * rainfall + a
There exist a handful of different ways to find a and b. The three main methods to perform linear
regression analysis in Excel are:
- Regression tool included with Analysis ToolPak
- Scatter chart with a trendline
-Linear regression formula
Below you will find the detailed instructions on using each method.