Input & options
Summary
Run the calculation to see metrics and the step log.
| Metric | Value |
|---|
How it’s calculated
Visualisation
Teacher notes
- Compare OLS, WLS, and Theil–Sen with or without an intercept to highlight how slope and tests respond to weighting or outliers.
- The step log records means, sums, coefficients, r/R², residual diagnostics, tests, ANOVA, and the LaTeX formula so students can follow each computation.
- The exported CSV includes x, y, w, fitted values, residuals, leverage, and Cook’s D for further analysis in spreadsheets.
How to use this regression calculator
Paste paired x,y data, check the decimal and separator settings, then choose the estimator and intercept rule you want to compare. The page is built to show both the fitted line and the diagnostics that explain whether the model is actually useful.
Start with the input format
Use one row per observation. If your locale uses commas for decimals, confirm that the separator setting still matches the dataset, otherwise the parser can split one number into two columns by mistake.
How to read the result
The summary table reports slope, intercept, correlation, and fit statistics. The scatter plot shows whether the line is visually plausible, while the residual plot helps you spot curvature, outliers, or changing variance.
When to switch method
Use OLS for the default least-squares fit, WLS when weights are meaningful, and Theil-Sen when you want a more robust slope against outliers. Comparing the methods is often more informative than looking at one fit in isolation.
Common mistakes to avoid
- Mixing decimal commas and comma separators without checking the parser settings.
- Reading a high R² as proof that the model is appropriate without checking the residual plot.
- Using weighted regression when the weight column does not represent a clear sampling or precision rule.
- Sharing the URL without sharing the dataset, since the link stores options but not the raw data table.
Related tools
FAQ
How is Weighted Least Squares implemented?
We recompute weighted means and covariances using w, derive the fitted line, and propagate weights to residual sums and Cook’s distance so diagnostics reflect the weighting scheme.
What does the shareable URL include?
The URL stores decimal, delimiter, estimator, intercept, and band options. Data is not embedded, so share the dataset separately when collaborating.
Why is the dataset not included in the shareable URL?
The URL stores parsing and model options only. That keeps links short and avoids accidental disclosure of data you may not want embedded in a public address bar.
Why can a fit with high R² still be misleading?
R² only summarizes how much of the variance is explained by the fitted line. A high R² can still hide outliers, curvature, grouped structure, or residual patterns that tell you the linear model is incomplete.
When should I use Theil-Sen instead of OLS?
Use Theil-Sen when a few outliers strongly tilt the ordinary least-squares line or when you want a robust slope for exploratory analysis. It is slower, but it is often easier to defend on noisy classroom or field data.
How to interpret the diagnostics
Slope and intercept
The slope tells you how much y changes for one unit of x under the fitted model. The intercept is meaningful only if x = 0 is a sensible point in your context, so do not over-interpret it automatically.
Residual plot
Use the residual plot to check whether the line leaves a pattern behind. Curvature, fan shapes, or a few extreme points usually matter more than one summary number.
Bands and uncertainty
The confidence band is about the mean fitted line, while the prediction band is about future observations. If you are teaching the difference, turning both on and off is often the clearest demonstration.
Teacher note
This page works best when students compare the raw scatter, the fitted line, and the residual view together. The model is only trustworthy when those three views tell a coherent story.
How it’s calculated