EDUC 15
  • Syllabus
  • Schedule
  • Content
  • Resources
  • Canvas
  1. Statistics simulator
  2. Correlation and regression
  • Overview
    • Resources
  • Statistics simulator
    • Sampling distributions
    • Power
    • Confidence intervals
    • Correlation and regression
  • Data
  • Regression handout
  1. Statistics simulator
  2. Correlation and regression

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.

Confidence intervals
Data

Content 2027 by Andreas de Barros
All content licensed under a Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC 4.0), except the Mindspark data, which are CC BY 4.0

 
  • Edit this page
  • Report an issue

Made with and Quarto
View the source at GitHub