how to calculate the line of best fit
a regression with two independent variables such as the example discussed above will produce a formula with this basic structure in this equation y is the dependent variable c is a constant b1 is the first regression coefficient and x1 is the first independent variable the second coefficient and second independent variable are b2 and x2 respectively drawing from the above example the stock price would be y the s p 500 would be x1 and the unemployment rate would be x2 the coefficient of each independent variable represents the degree of change in y for each additional unit in that variable if the s p 500 increases by one the resulting y or share price will go up by the amount of the coefficient the same is true for the second independent variable the unemployment rate in a simple regression with one independent variable that coefficient is the slope of the line of best fit in this example or any regression with two independent variables the slope is a mix of the two coefficients the constant c is the y intercept of the line of best fit 