Multiple regression: the contribution of price, discount and traffic to sales
From a table of periods estimates how sales depend on up to three factors at once (for example price, discount depth, traffic): coefficients with confidence intervals and p-values, R², a check of the factors’ interdependence (VIF), the effect of a one-standard-deviation shift of a factor and a forecast at given values with a band.
At a glance
- What question does it answer?
- By how many units sales change when one factor changes with the others unchanged, and how far the model can be trusted.
- What data is needed?
- Sales and up to three factors by week or month.
- How to read the result?
- Example on the default values (24 weeks): R² 98.3%, coefficients: price −0.046 units per rouble, discount 3.14 units per percentage point, traffic 0.91 units per thousand. The forecast at a price of 3,900, a discount of 15% and traffic of 120: 239 units, the band from 228 to 251. Example on the default values: R²: 98.3%; Adjusted R²: 98%; Model standard error: 5.3; Overall significance (p, F test): <0.05%. The figures are illustrative: enter your own to see your result.
Why and how to reason
Sales depend on several causes at once: price, discount, traffic. If each is looked at separately there is confusion: a discount coincided with a rise in traffic, and it is unclear who helped. Multiple regression selects coefficients so that the sum of squared deviations from actual sales is the smallest: b = (XᵀX)⁻¹Xᵀy. The result: sales = 261 − 0.046 × price + 3.14 × discount (points) + 0.91 × traffic. It reads: a rise in price of 100 lowers sales by 4.6 units, each point of discount adds 3.1 units, and each visitor 0.9. R² of 98% shows that the three factors explain almost all the variability. Each coefficient has an interval and a p-value. VIF checks whether factors are related to each other: at 1.1 all is well. The forecast at price 3,900, discount 15 and traffic 120 is 239 with an interval of 228 to 251.
When to use it
It fits when there is a history by periods with enough observations (at least 5 to 10 times the number of factors) and the factors moved independently. Do not use it if factors moved together (a discount always with advertising) or there are few periods: then the coefficients are unstable. Assumptions: the link is linear, errors are independent, there are no hidden factors (season, competitors), the future resembles the past.
How to read the result
Look at three things. The sign and size of coefficients: do they match common sense (price reduces, discount increases). Intervals and p-values: a coefficient with an interval including zero is not proven. VIF: if above the threshold (5), factors duplicate each other, and the coefficients cannot be interpreted separately. The “effect of a one-SD shift” helps compare factors of different scale. The forecast interval shows the range: if the target lies in it, the result is attainable. Match the conclusion with a test: regression shows a link, it does not prove a cause. It is worth writing the final formula in words for colleagues (“a point of discount gives about three units”): then the model becomes an understandable rule, not a black box.
Common mistakes
The usual mistakes: fitting the model to a high R² by adding factors, forecasting beyond observed values, not checking VIF, taking weeks with shortages as demand, mistaking a link for a cause. For a price decision confirm the coefficient with a small test. Do not include in the model factors that you set at the same time (discount and advertising in the same weeks): their effects cannot be separated.
What data is needed?
- Sales and up to three factors by week or month.
- At least three observations beyond the number of parameters.
- The factor values for the forecast.
Inputs
| Field | Unit | Value in the example | Meaning |
|---|---|---|---|
| Factor 1 in the forecast | 3,900 | The value of the first factor (the price in the example) at which the forecast is counted. Empty: no forecast. | |
| Factor 2 in the forecast | 15 | The value of the second factor (the discount depth in the example). Needed if factor 2 is used. Optional. Empty: the field is ignored (counted as zero in sums). | |
| Factor 3 in the forecast | 120 | The value of the third factor (traffic in the example). Needed if factor 3 is used. Optional. Empty: the field is ignored (counted as zero in sums). | |
| VIF threshold for the warning | 5 | Above the threshold the factors are too alike and the coefficients are unstable. There is no single standard, 5 or 10 is taken; the value is yours. |
How it is calculated
| Step | Formula |
|---|---|
| Coefficients | b = (XᵀX)⁻¹ Xᵀ y |
| Errors | σ² = SSE ÷ (n − p); the coefficient error = √(σ² × the diagonal of (XᵀX)⁻¹) |
| t, p | t = coefficient ÷ error; p from the Student distribution with n − p degrees of freedom |
| R² | 1 − SSE ÷ SST; adjusted: 1 − (1 − R²) × (n − 1) ÷ (n − p) |
| VIF | 1 ÷ (1 − R² of regressing the factor on the others) |
| Forecast band | ± t × σ × √(1 + x₀ᵀ (XᵀX)⁻¹ x₀) |
Worked numbers
Default values from the app; in the interactive version you enter your own.
- R²
- 98.3 %What share of the sales spread the factors explain. It grows when any factor is added.
- Adjusted R²
- 98 %R² corrected for the number of factors: it grows only if a factor is useful.
- Model standard error
- 5.3The typical deviation of the actual from the model, in sales units.
- Overall significance (p, F test)
- <0.05 %
- Observations
- 24
- Intercept
- 261.09
- Coefficient: Factor 1
- −0.046The change in sales when the factor rises by one with the others unchanged; interval from −0.055 to −0.037, p 0%.
- Coefficient: Factor 2
- 3.14The change in sales when the factor rises by one with the others unchanged; interval from 2.867 to 3.414, p 0%.
- Coefficient: Factor 3
- 0.914The change in sales when the factor rises by one with the others unchanged; interval from 0.739 to 1.088, p 0%.
- Largest VIF
- 1.11×
- Sales forecast at the given factors
- 239
- Forecast: lower bound 95%
- 228
- Forecast: upper bound 95%
- 251
- points
- regression line: y = 0 + 1·x
Data as a table
| Sales by the model, units | Actual sales, units | |
|---|---|---|
| 187.7 | 186 | |
| 190.5 | 194 | |
| 224.6 | 224 | |
| 195.9 | 194 | |
| 245.8 | 241 | |
| 201.4 | 200 | |
| 226.7 | 235 | |
| 166.7 | 170 | |
| 169.4 | 176 | |
| 301 | 304 | |
| 225.2 | 227 | |
| 219.1 | 221 | |
| 181.3 | 172 | |
| 184 | 190 | |
| 218.2 | 222 | |
| 189.5 | 193 | |
| 239.4 | 230 | |
| 154.8 | 145 | |
| 261.5 | 257 | |
| 201.4 | 199 | |
| 204.2 | 206 | |
| 294.5 | 296 | |
| 178.6 | 182 | |
| 212.7 | 210 |
Data as a table
| Measure | Effect |
|---|---|
| Factor 1 | −5.5 |
| Factor 2 | 13.3 |
| Factor 3 | 6 |
Model coefficients
| Term | Coefficient | Standard error | t | p, % | Lower 95% | Upper 95% | VIF |
|---|---|---|---|---|---|---|---|
| Intercept | 261.09 | 20.059 | 13.02 | 0 | 219.247 | 302.933 | — |
| Factor 1 | −0.046 | 0.004 | −10.32 | 0 | −0.055 | −0.037 | 1.03 |
| Factor 2 | 3.14 | 0.131 | 23.97 | 0 | 2.867 | 3.414 | 1.11 |
| Factor 3 | 0.914 | 0.084 | 10.92 | 0 | 0.739 | 1.088 | 1.09 |
Regression shows an association and not a cause: if discounts were given in the high-traffic season their effect mixes with the season. Add a seasonal factor or count within one season. The forecast band holds inside the range of your data.
Nuances and limits
- Reading a coefficient as a cause: discounts and the season may coincide.
- Including strongly related factors (VIF above the threshold): the coefficients jump.
- Forecasting outside the data range: the line is untested there.