Correlation and regression
Drag points on a scatter plot and watch the correlation, the line and the residuals change.
Drag any point and watch r and the regression line respond. Click empty space to add a point. You can turn on the residuals and their squares, or load your own data, which stays in your browser.
Open the simulator in a full window
Things to try
Each link opens the simulator ready to go. Before you press a button, predict what will happen.
How do correlation and regression relate?
- A slope with n = 20. Each dot is one estimate b. The table compares the average a and b with the true intercept and slope. The intercept is where the line meets X = 0, so try a different true intercept: the line moves, and the slope doesn’t.
- A yes/no predictor. With a yes/no X, the slope is just the difference between two group means, and its t is the t from a two-sample test.
- Drag the points. Pull one point far away, and see what happens to the line, r and the residuals. Then try it with many points.
- The class data. Each dot is one Mindspark student’s math score at baseline and at endline, as in Topics 11 to 13. Now press Swap X and Y. Which numbers stay the same, and which change?
Credit
This simulator was written for EDUC 15. This view was inspired by the correlation visualization by Kristoffer Magnusson at R Psychologist.