VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Mathematics? | Regression Leverage, the Hat Matrix and Predictor Space

Why is mathematics important when a predictor combination sits far from the rest of the data? Regression leverage measures how strongly each row’s predictor position helps determine its own fitted value. The diagonal of the hat matrix turns geometry into an auditable diagnostic.

Leverage concerns the inputs, not the response error. It helps students see where a model is interpolating and where it is being pulled toward the edge of its evidence.

Did you know? Leverages sum to the number of fitted parameters, so the average leverage is p/n.

Full chapter index

Chapters 1–4 · Understand the question
  1. The predictor-space question
  2. The hat matrix
  3. A simple-regression formula
  4. A worked example
Chapters 5–9 · Reproduce the example
  1. Check the sum
  2. Bounds
  3. Geometry of projection
  4. Leverage is input-based
  5. High leverage is not an error
Chapters 10–15 · Check assumptions
  1. Leverage and influence
  2. Thresholds as screens
  3. Multiple predictors
  4. Categorical predictors
  5. Extrapolation risk
  6. Collinearity
Chapters 16–20 · Explore applications
  1. Scaling predictors
  2. Spreadsheet workflow
  3. Coding workflow
  4. Applications and careers
  5. Connection to recent mathematics articles
Chapters 21–24 · Study and verify
  1. Guidance for students and parents
  2. Practice questions
  3. Frequently asked questions
  4. Useful next reading

CHAPTER 1 OF 24 · Understand the question

1. The predictor-space question

Back to contents

A point near the centre of predictor values usually has modest leverage. A point in a sparse or extreme predictor region can strongly shape the fitted line or surface.

Contents · Next chapter

CHAPTER 2 OF 24 · Understand the question

2. The hat matrix

Back to contents

For ordinary least squares, H=X(X transpose X) inverse X transpose and fitted values equal Hy. NIST identifies diagonal h_ii values as leverage. Read the NIST regression-diagnostics reference.

Contents · Previous chapter · Next chapter

CHAPTER 3 OF 24 · Understand the question

3. A simple-regression formula

Back to contents

With an intercept and one predictor, h_i=1/n+(x_i−x-bar)² divided by the total squared distance of x values from x-bar. The first term is baseline leverage; the second measures predictor extremeness.

x valuesx meanSquared-distance sum
0, 1, 2, 31.55
Simple-regression predictor values.

Contents · Previous chapter · Next chapter

CHAPTER 4 OF 24 · Understand the question

4. A worked example

Back to contents

For x values 0,1,2,3, n=4, x-bar=1.5 and the squared-distance sum is 5. At x=3, leverage is 0.25+2.25/5=0.70.

BaselineDistance termh
0.250.450.7
Leverage for x=3.

Contents · Previous chapter · Next chapter

CHAPTER 5 OF 24 · Reproduce the example

5. Check the sum

Back to contents

With intercept and slope, p=2. The four leverages are 0.70,0.30,0.30,0.70 and sum to 2. This invariant catches matrix and indexing errors.

Contents · Previous chapter · Next chapter

CHAPTER 6 OF 24 · Reproduce the example

6. Bounds

Back to contents

Under the standard full-rank projection, leverage lies between 0 and 1. NIST notes a minimum related to 1/n and an average p/n.

Contents · Previous chapter · Next chapter

CHAPTER 7 OF 24 · Reproduce the example

7. Geometry of projection

Back to contents

The hat matrix projects observed responses onto the column space of X. A diagonal value measures how much the i-th response contributes to its own fitted value.

Contents · Previous chapter · Next chapter

CHAPTER 8 OF 24 · Reproduce the example

8. Leverage is input-based

Back to contents

Changing y while keeping X fixed leaves leverage unchanged. This distinguishes predictor-space unusualness from residual unusualness.

Contents · Previous chapter · Next chapter

CHAPTER 9 OF 24 · Reproduce the example

9. High leverage is not an error

Back to contents

A carefully designed experiment may intentionally include boundary points. They can be essential for identifying slopes. The question is whether they are valid and adequately supported.

Contents · Previous chapter · Next chapter

CHAPTER 10 OF 24 · Check assumptions

10. Leverage and influence

Back to contents

Influence needs both leverage and disagreement with the fitted model. Cook’s distance and DFFITS combine these ingredients in different ways.

Contents · Previous chapter · Next chapter

CHAPTER 11 OF 24 · Check assumptions

11. Thresholds as screens

Back to contents

Conventions such as two or three times average leverage can flag cases, but they are not universal decision rules. Model structure and design matter.

Contents · Previous chapter · Next chapter

CHAPTER 12 OF 24 · Check assumptions

12. Multiple predictors

Back to contents

A row can have ordinary values on each variable yet an unusual combination across variables. Multivariate leverage can detect that pattern even when pairwise plots do not.

Contents · Previous chapter · Next chapter

CHAPTER 13 OF 24 · Check assumptions

13. Categorical predictors

Back to contents

Rare categories and interactions can create high leverage. Interpret the design matrix, not only the original labels.

Contents · Previous chapter · Next chapter

CHAPTER 14 OF 24 · Check assumptions

14. Extrapolation risk

Back to contents

Predictions far outside the observed predictor cloud may have high uncertainty even though there is no observed row to diagnose. Leverage teaches the broader lesson of staying inside supported regions.

Contents · Previous chapter · Next chapter

CHAPTER 15 OF 24 · Check assumptions

15. Collinearity

Back to contents

Near-dependent predictor columns can make coefficient estimates unstable and affect geometry. Condition diagnostics and VIF complement leverage.

Contents · Previous chapter · Next chapter

CHAPTER 16 OF 24 · Explore applications

16. Scaling predictors

Back to contents

Changing units alone should not change the fitted subspace when the transformation is handled consistently. Numerical conditioning can still improve after centring and scaling.

Contents · Previous chapter · Next chapter

CHAPTER 17 OF 24 · Explore applications

17. Spreadsheet workflow

Back to contents

For simple regression, use the scalar formula. For multiple regression, rely on matrix-capable software and check that leverage sums to p.

Contents · Previous chapter · Next chapter

CHAPTER 18 OF 24 · Explore applications

18. Coding workflow

Back to contents

Use a tested linear-model routine, preserve row IDs and return leverage with residual and influence diagnostics. Verify full rank and intercept handling.

Contents · Previous chapter · Next chapter

CHAPTER 19 OF 24 · Explore applications

19. Applications and careers

Back to contents

Leverage analysis supports experimental design, sensor calibration, economics, ecology and AI regression pipelines. It shows where evidence is sparse but consequential.

Contents · Previous chapter · Next chapter

CHAPTER 20 OF 24 · Explore applications

20. Connection to recent mathematics articles

Back to contents

The Cook’s-distance guide combines leverage with residual size. The pooled-standard-deviation guide develops degrees-of-freedom reasoning.

Contents · Previous chapter · Next chapter

CHAPTER 21 OF 24 · Study and verify

21. Guidance for students and parents

Back to contents

Students should describe the predictor position before interpreting a leverage value. Parents can ask whether edge cases are errors, planned boundary measurements or unsupported extrapolations.

Contents · Previous chapter · Next chapter

CHAPTER 22 OF 24 · Study and verify

22. Practice questions

Back to contents

  • Verify all four leverages in the worked example.
  • Add x=10 and predict which leverage grows.
  • Explain why changing y does not change H.

Contents · Previous chapter · Next chapter

CHAPTER 23 OF 24 · Study and verify

23. Frequently asked questions

Back to contents

### Is leverage the same as influence? No. Leverage describes predictor position; influence describes model change.

### Can leverage be negative? Not for ordinary diagonal hat values.

### Does high leverage mean delete? No. Validate and investigate.

Contents · Previous chapter · Next chapter

CHAPTER 24 OF 24 · Study and verify

24. Useful next reading

Back to contents

Use the Mathematics Learning Hub and plot predictor space, leverage and Cook’s distance together.

Contents · Previous chapter · Mathematics Learning Hub

Extended practice laboratory

Practice case 1: Build design matrix

Setup: Use the article’s regression-leverage example and change one declared input for case 1. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 2: Include intercept

Setup: Use the article’s regression-leverage example and change one declared input for case 2. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 3: Calculate X transpose X

Setup: Use the article’s regression-leverage example and change one declared input for case 3. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 4: Invert cross-product

Setup: Use the article’s regression-leverage example and change one declared input for case 4. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 5: Form hat matrix

Setup: Use the article’s regression-leverage example and change one declared input for case 5. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 6: Extract diagonal

Setup: Use the article’s regression-leverage example and change one declared input for case 6. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 7: Sum leverage values

Setup: Use the article’s regression-leverage example and change one declared input for case 7. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 8: Check p over n average

Setup: Use the article’s regression-leverage example and change one declared input for case 8. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 9: Use simple-regression shortcut

Setup: Use the article’s regression-leverage example and change one declared input for case 9. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 10: Calculate predictor mean

Setup: Use the article’s regression-leverage example and change one declared input for case 10. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 11: Calculate squared-distance sum

Setup: Use the article’s regression-leverage example and change one declared input for case 11. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 12: Move one x outward

Setup: Use the article’s regression-leverage example and change one declared input for case 12. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 13: Change y only

Setup: Use the article’s regression-leverage example and change one declared input for case 13. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 14: Add a rare category

Setup: Use the article’s regression-leverage example and change one declared input for case 14. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 15: Add an interaction

Setup: Use the article’s regression-leverage example and change one declared input for case 15. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 16: Inspect predictor cloud

Setup: Use the article’s regression-leverage example and change one declared input for case 16. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 17: Compare influence

Setup: Use the article’s regression-leverage example and change one declared input for case 17. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 18: Check extrapolation

Setup: Use the article’s regression-leverage example and change one declared input for case 18. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 19: Check matrix rank

Setup: Use the article’s regression-leverage example and change one declared input for case 19. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 20: Centre predictors

Setup: Use the article’s regression-leverage example and change one declared input for case 20. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 21: Scale units

Setup: Use the article’s regression-leverage example and change one declared input for case 21. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 22: Compare partial leverage

Setup: Use the article’s regression-leverage example and change one declared input for case 22. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 23: Avoid automatic deletion

Setup: Use the article’s regression-leverage example and change one declared input for case 23. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.

Practice case 24: Write a leverage conclusion

Setup: Use the article’s regression-leverage example and change one declared input for case 24. Task: Recalculate from raw values, preserve units and state which mathematical or design condition changed.

Check: Check the relevant invariant, separate the number from its claim, and name the next diagnostic or source of evidence. Rebuild the relevant counts before interpreting the coefficient, preserve the stated design, and write one sentence separating the numerical result from the claim it can support. Then vary one defensible assumption, calculate again, and explain whether the conclusion changes because of new data, a new reference model, or a new decision purpose. Finish by naming the unit, tolerance, and evidence needed for transfer. Record one graph or table that would expose failure hidden by the summary.