Regression analysis
Regression analysis estimates how one variable, the outcome, changes with one or more other variables, the explanatory variables, by fitting an equation to observed data. Ordinary least squares, the usual method, picks the equation with the smallest sum of squared gaps between observed and fitted values.
What it is
Regression analysis is a statistical method that estimates how an outcome variable, such as sales, depends on one or more explanatory variables, such as price or advertising spend. It fits an equation to observed data and reports the size of each relationship. The outcome is also called the dependent variable or response. The explanatory variables are also called independent variables or regressors.
The NIST handbook describes the linear form: each explanatory variable is multiplied by an unknown coefficient, the terms are added, and a constant is usually included. A model counts as linear when it is linear in the coefficients, even if an explanatory variable enters as a square or a logarithm.
For one explanatory variable the model is:
y = a + b x + e
- y: the outcome.
- x: the explanatory variable.
- a: the constant, the fitted value of y when x is zero.
- b: the slope, the change in y associated with one unit of x.
- e: the residual, the part of y that the line does not explain.
The NIST handbook states that least squares finds the coefficients by minimising the sum of the squared differences between the data and the model.
Why it matters
Regression turns a question such as “how much does volume change when price changes” into a number with a stated method. It also gives a fitted value for any combination of the explanatory variables, which supports forecasting on drivers and not only on the history of the series itself.
A fitted relationship that is read as proof of cause, or applied outside the range of the data, gives a misleading answer. The residuals are the check on whether the model describes the data.
Worked example
Illustrative numbers. A business records advertising spend (x, in thousands) and sales (y, in thousands) over five periods: x = 1, 2, 3, 4, 5 and y = 12, 15, 19, 22, 27.
- Means: x is 3 and y is 19.
- Slope b: the sum of products of deviations is 37 and the sum of squared x deviations is 10, so b = 3.7.
- Constant a: 19 minus 3.7 x 3 = 7.9.
- Fitted line: y = 7.9 + 3.7 x. At x = 6 the fitted value is 30.1.
- Residuals: 0.4, -0.3, 0.0, -0.7 and 0.6. They sum to zero, and their squares sum to 1.1.
Each extra thousand of spend is associated with 3.7 thousand of sales in this data. The value at x = 6 lies outside the observed range of x, so it is an extrapolation.
How to read it
The slope gives direction and size. A positive slope means the outcome rises with the explanatory variable. Residuals that scatter without a pattern suggest the line fits. Residuals that curve or widen suggest that the form of the model is wrong.
Assumptions
- The relationship has the form the model assumes, such as a straight line.
- The NIST handbook notes that least squares is the best choice when residuals have a mean of zero, a constant variance and no correlation with one another.
- Explanatory variables are measured without material error and are not near-copies of each other.
Who uses it
- FP&A analysts regress revenue or cost on drivers such as volume or headcount to build forecasts.
- Commercial finance analysts estimate the response of demand to price or activity.
- Economists and macro researchers estimate relationships between economic series.
- Statisticians fit, test and document models and check the residuals.
- Credit risk model developers use regression to link borrower characteristics to outcomes.
Common confusions
- A fitted slope is an association and not proof of cause. Confounding variables can produce the same slope.
- A line that fits the past closely is not a tested forecast. Accuracy is judged on data the model has not seen.
- Linear regression does not require a straight line in the variables. It requires linearity in the coefficients.
- Regression on time is only one use. Regression on drivers explains why a series moves.