An interactive guide to understanding how matrix operations power linear regression
Click any cell in the result matrix to see how it is computed. The animation has two steps: first you see which numbers pair up, then you see the computation.
A step-by-step visual derivation of the OLS formula. Use the buttons to walk through the algebra.
Walk through each step of computing OLS coefficients from real data. Click the step numbers to navigate.
Adjust the correlation between x1 and x2 and see how it affects the estimated coefficient on x1.
Imagine you want to measure the effect of advertising (x1) on sales. But advertising spending is correlated with store size (x2), and bigger stores also have more sales.
The slider below lets you see this in action. As the correlation between x1 and x2 increases, the simple regression coefficient becomes more biased — it picks up effects that actually belong to x2.