
Multiple linear regression: slope and intercept The slope and intercept values can also be obtained separately by using the corresponding function or by nesting the LINEST formula into INDEX:Īs shown in the screenshot below, all three formulas yield the same results: Supply the above values to a simple linear regression equation, and you will get the following formula to predict the sales number based on the advertising cost:įor example, if you spend $50 on advertising, you are expected to sell 21 umbrellas: If plotted on a graph, it is the value at which the regression line crosses the y-axis. It means that when x increases by 1, y increases by 0.52. The slope is approximately 0.52 (rounded to two decimal places). The formula will return the slope coefficient in the first cell (E2) and the intercept constant in the second cell (F2): To enter it correctly in your worksheet, select two adjacent cells in the same row, E2:F2 in this example, type the formula, and press Ctrl + Shift + Enter to complete it.

The last two arguments can be set to TRUE or omitted.įor example, with y values (sales numbers) in C2:C13 and x values (advertising cost) in B2:B13, our linear regression formula is as simple as: To get the intercept and the slope of a regression line, you use the LINEST function in its simplest form: supply a range of the dependent values for the known_y's argument and a range of the independent values for the known_x's argument. Below, you will find a few examples of using LINEST formulas in Excel that will hopefully help to sink the theoretical knowledge in :) Simple linear regression: calculate slope and intercept The LINEST function might be tricky to use, especially for novices, because you should not only build a formula correctly, but also properly interpret its output.
#Reading excel linear regression equations how to#
How to use LINEST in Excel - formula examples It is the default behavior of the LINEST function, but if you'd like to hide the error notations, wrap your LINEST formula into IFERROR as shown in this example. In the last three rows, the #N/A errors will appear in the third and subsequent columns that are not filled with data. The below map shows the order in which LINEST returns an array of statistics: Measures the amount of variance in the dependent variable that is not explained by your regression model. Indicates how much of the variation in the dependent variable is explained by the model. It is used to do the F-test for the null hypothesis to determine the overall goodness of fit of the model.

Shows the precision of the regression analysis. Indicates how well the regression equation explains the relationship among the variables. The standard error value for the constant a. The standard error value(s) for the b coefficient(s). The stats argument set to TRUE instructs the LINEST function to return the following statistics for your regression analysis: Statistic If it is entered as a regular formula, only the first slope coefficient is returned. Since LINEST returns an array of values, it must be entered as an array formula by pressing the Ctrl + Shift + Enter shortcut. The function uses the least squares method to find the best fit for your data. The LINEST function calculates the statistics for a straight line that explains the relationship between the independent variable and one or more dependent variables, and returns an array describing the line. 5 things you should know about LINEST functionĮxcel LINEST function - syntax and basic uses.LINEST formula: additional regression statistics.


Our main focus will be on providing you with a formula that simply works and can be easily customized for your data. In this tutorial for beginners, we will touch only lightly on theory and underlying calculations. One of such functions is LINEST, which is designed to perform linear regression analysis and return related statistics. Microsoft Excel is not a statistical program, however, it does have a number of statistical functions. This tutorial explains the syntax of the LINEST function and shows how to use it to do linear regression analysis in Excel.
