Library / Statistics / STA-07
Statistics
Regression slope
Slope of the least-squares line: how much y changes, on average, for a one-unit rise in x.
- Ref
- STA-07
- Rev
- v1
- Field
- Statistics
- Result
- b
S_xy = Σ(x − x̄)(y − ȳ) and S_xx = Σ(x − x̄)². The least-squares line is y = ȳ + b(x − x̄), so it always passes through the point of means. b has units of y per unit of x.
Slope of the least-squares line: how much y changes, on average, for a one-unit rise in x.
Calculator
- Change in y for a 10-unit rise in x12
- Change in x along the line for a 1-unit change in y0.8333
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- A slope of 1.2 means y rises by 1.2 units on average for each unit increase in x.
- Do not extrapolate far beyond the range of x in the data: the straight line may stop holding.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing () | Local step | Change in result |
|---|---|---|---|---|---|---|
| Sxx Sum of squares of x | 1 to 1,000 | 0.12 | 120 | 119.9 | +10% | −9.09 % |
| Sxy Sum of cross-products | −1,000 to 1,000 | −10 | 10 | 20 | +40 | +33.3 % |
Sweep of Sum of squares of x
| Sum of squares of x | Slope |
|---|---|
| 1 | 120 |
| 2.371 | 50.6 |
| 5.623 | 21.34 |
| 13.34 | 8.999 |
| 31.62 | 3.795 |
| 74.99 | 1.6 |
| 177.8 | 0.6748 |
| 421.7 | 0.2846 |
| 1,000 | 0.12 |
Sweep one variable
Variables and how each one contributes
Slope
What the equation gives you. Everything else feeds it.
Sum of cross-products
The sum of the products of the x and y deviations. Directly proportional; a negative S_xy gives a falling line.
Sum of squares of x
The sum of squared deviations of x. Inverse: x values clustered closely (small S_xx) give a steep, poorly-determined slope.
Worked example with the values above
- Cross-products: S_xy = 120.
- Sum of squares of x: S_xx = 100.
- b = 120 / 100 = 1.2.
Assumptions and limits
- A straight-line relationship, with scatter in y roughly constant across x.
- x is measured much more accurately than y.
Common mistakes
- Swapping x and y: the slope of x on y is not the reciprocal of the slope of y on x.
- Using the slope without checking how well the line fits.
Statistics and uncertainty
The slope has its own standard error, s/√S_xx. If the interval around the slope includes zero, the data do not support a trend.
Where it is used
- Fitting a calibration line to instrument readings.
- Estimating a rate of change from noisy data.
Maths you need
- Straight lines: gradient and intercept
- Sums of squares: S_xx