Linear Regression
Ordinary least squares for y = β₀ + β₁x, fitted live. Pick a real-world scenario (house prices, study hours, ice-cream sales) or stay with abstract x and y. Every quantity is the exact closed-form answer, recomputed on every drag. Start in Beginner mode for the essentials; switch to Advanced for the full inference table, formulas, and diagnostics.
How to use
- Choose a scenario from the dropdown to give the axes real-world meaning, or keep the abstract x-y view.
- Click anywhere on the plot to add a point. Drag points to move them; double-click one (or press Delete) to remove it.
- Set β₀, β₁, σ, and n, then click "Generate data" to sample from a known true line and compare it to the fit.
- Toggle the residuals to see the vertical misses that least squares is minimizing.
- Drag one point far from the others and watch the leverage: a single outlier can pivot the whole line.
- Toggle the 95% CI band: it pinches at the mean of x, where the line is known best.
Predictors
Data generator (y = β₀ + β₁x + noise)
Formula
General form
With your values
Diagnostics
The four diagnostic plots from R's plot(lm(...)). Apricot markers in the leverage plot have Cook's distance above 4/n (influential).