EDUC 265
  • Syllabus
  • Schedule
  • Content
  • Assignments
  • Resources
  • Perusall
  • Canvas
  1. Interactive
  2. Regression explorer
  • Overview
    • Resources
  • Interactive
    • Regression explorer
    • Sampling distributions
    • Statistical power
  • Causal inference
    • Going beyond
  • R
    • R
    • Installing R, RStudio, tidyverse, and tinytex
    • R style suggestions
    • Using Markdown
    • Using R Markdown
  • Stata
    • Stata
  • Other topics
    • Citations and bibliography
    • Data
    • Unzipping files
    • Writing and presenting
  1. Interactive
  2. Regression explorer

Regression explorer

Drag the data points and watch the regression line, r, and the standard error respond.

In the Week 2 reading, the data stay put and you move the line. Here it’s the other way around: you move the data, and OLS moves the line. It shows how much a line depends on any one observation.

This is a tool to play with, not an assignment. We use it in class.

Open the explorer in a full window

Things to try

Each link opens the explorer ready to go. Before you press anything, predict what will happen.

  • One student, in a small sample. Start with 12 points. Press Add outlier, and watch the slope and the p-value. Then try it with 200 points.
  • Why that one point pulls so hard. Show the squared residuals. Drag a point away from the line and watch its square grow. A point twice as far away counts four times as much, because OLS minimizes the sum of the squares.
  • Middle or edge? Start with 12 points again. Drag a point near the middle of X straight up. Then do the same with the point furthest to the right. Which one tilts the line more?
  • Real students. Load the Mindspark data, the 273 lottery losers from Section 1.2 of the Week 2 reading. You get the same line: 22.3 + 0.75 × baseline. Press Add outlier. How much does one student matter here?
  • Which variable goes on the left? Same data. Press Swap X and Y. The slope falls from 0.75 to 0.35. Which numbers stay the same?
  • The middle of the data. Show the means. Drag any point you like. The line always passes through the spot where the two means cross.

You can also load your own data, as a CSV with X and Y in the first two columns. The file stays in your browser.

Credit

This tool was written for EDUC 15 and adapted for this course. It was inspired by Kristoffer Magnusson’s correlation visualization at R Psychologist.

Resources
Sampling distributions

Original content 2027 by Andrew Heiss
Additional content 2027 by Andreas de Barros
All content licensed under a Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC 4.0)

 

Made with and Quarto