Trend Lines & Linear Models
Fit statistical trends to scatter points. Informally position manual lines to minimize errors, or calculate the exact Least Squares Regression equation.
Least Squares Optimization Visualizer
Click the canvas to add data points (right-click or double-click to remove). Drag data points to shift coordinates. If "Show Manual Trend Line" is checked, drag the large amber handle rings (Anchor 1 & Anchor 2) at the sides to fit your line, aiming to minimize the Sum of Squared Residuals.
1. Data Presets
2. Fit Comparison Dashboard
Linear Modeling Walkthrough
Trace how residuals are calculated and how least-squares formulas establish slopes and intercepts.
Trace Calculations Steps
Residuals Computation Matrix
Trend Lines & Fitting Quiz
Test your conceptual knowledge of lines of best fit, residuals, least-squares requirements, and slopes.
Quiz question loading...
Explanation text...
Trend Lines Key Rules
- Residual: The vertical difference between an observed data value $y_i$ and the value predicted by the line $\hat{y}_i$: $e_i = y_i - \hat{y}_i$.
- Least Squares Line (LSRL): The unique line that minimizes the sum of all squared residuals ($\sum e_i^2$).
- Slope (m) interpretation: Indicates the expected change in the dependent variable ($y$) for each unit increase in the independent variable ($x$).
- R-Squared ($R^2$): The coefficient of determination. It represents the proportion of variance in $y$ that is predictable from $x$. Values close to 1 indicate an excellent model fit.