← Back to works

Scatter diagram, correlation, and the regression line

Probability and statistics High-school concept
Adjust parameters Hide parameters Scroll down to adjust

Parametric equations

Given points . This page reads the cloud as a whole: the mean point, how linear the cloud is, and one straight line for the main trend. The mean point is

When both axes have nonzero variation, the Pearson correlation is

When the are not all equal, the least-squares line is the line whose slope and intercept minimize the residual sum of squares . It passes through . This page does not study one point on its own. That is left to the page on an outlier’s effect on the regression line.

Interaction

  • Sample size n and Noise σ: change how many points there are and how widely they scatter, and watch the line settle or wander
  • Linear trend β and Curvature c: change the trend the points are built from, and see where a straight line fails on a curved cloud
  • Mean axes: mark with a cross. The line always passes through that center
  • Residuals: draw the vertical segments
  • Shift left and Shift right translate the cloud. Shrink and Enlarge scale it about the mean point. Flip y reflects it vertically and changes the sign of the trend slider. Reset rebuilds the cloud from the sliders. A point that hits the edge of the plot is clipped, so the shift and the scale stay pure only while every point remains inside the frame
  • Double-click empty space in the plot to add a point. Double-click a point to delete it when more than three points remain

What to notice

  • The line passes through the mean point. That point is the hinge of the cloud, and it moves when the points move.
  • measures only linear agreement. A clearly curved cloud can still have near .
  • A translation, or a positive scaling about the mean, does not change . Reversing one axis reverses the sign of .

Further reading

Comments

Comment with a GitHub account.

← Back to works