Theil-Sen Slope Estimator Calculator

Analyze robust trends using pairwise slope medians. Import points, review fits, and inspect residual summaries. Download clean reports and plots for validation workflows today.

Calculator

Use comma, space, tab, or semicolon between x and y.

Accepted Input Rules

  • Each line should contain one x value and one y value.
  • At least two valid points are required.
  • Duplicate x values are ignored in slope pair calculations only.
  • The method remains resistant to outliers.

Quick Example

1,2
2,3
3,5
4,4
5,6
6,8

What This Page Returns

  • Median pairwise slope estimate
  • Median intercept estimate
  • Fitted values and residuals
  • Residual summary metrics
  • Scatter and fitted trend chart
  • CSV and PDF exports

Example Data Table

x y Comment
12Starting observation
23Moderate increase
35Higher response
44Small deviation
56Trend continues
68Upper range point

Formula Used

The Theil-Sen slope estimator computes every pairwise slope between distinct x values:

sij = (yj - yi) / (xj - xi)

The final slope estimate is the median of all valid pairwise slopes:

b1 = median(sij)

The intercept is estimated from the median of pointwise intercepts:

b0 = median(yi - b1xi)

The fitted line is then:

ŷ = b0 + b1x

This method is preferred when data may include outliers because the median is less sensitive than least squares averaging.

How to Use This Calculator

  1. Enter one x,y pair on each line.
  2. Use commas, spaces, tabs, or semicolons as separators.
  3. Click Calculate to estimate the resistant trend line.
  4. Review the slope, intercept, residual metrics, and fitted table.
  5. Inspect the graph to compare observed values against the robust fit.
  6. Download the results as CSV or PDF when needed.

FAQs

1. What does the Theil-Sen slope estimate measure?

It estimates the central slope of a linear trend by taking the median of slopes formed from all valid point pairs. This makes the estimate resistant to unusual observations.

2. Why use this instead of ordinary least squares?

Ordinary least squares can shift strongly when outliers exist. The Theil-Sen method usually changes less because medians are more stable than means under contamination.

3. Can duplicate x values be used?

Yes, but pairwise slopes with identical x values are skipped because division by zero is undefined. Other valid pairs are still used.

4. What intercept does this calculator report?

It reports the median intercept computed as y minus slope times x for each point. This pairs naturally with the median slope estimate.

5. Is this method only for perfectly linear data?

No. It summarizes the central monotonic linear tendency in noisy data. Strong curvature can still reduce fit quality, so inspect residuals and the plot.

6. What do MAE and RMSE show?

MAE shows average absolute error. RMSE gives more weight to larger residuals. Together they help assess how close the fitted line stays to observed values.

7. Does the graph use the robust fitted line?

Yes. The chart displays the original scatter points and the fitted line derived from the computed Theil-Sen slope and intercept.

8. When is this estimator especially useful?

It is useful in environmental, financial, engineering, and scientific datasets where a few abnormal observations could distort a standard regression line.

Related Calculators

Mann-Whitney U Test CalculatorKruskal-Wallis H Test CalculatorKendall Tau Correlation CalculatorChi-Square Goodness of Fit CalculatorSign Test CalculatorKolmogorov-Smirnov One Sample Test CalculatorKolmogorov-Smirnov Two Sample Test CalculatorJonckheere-Terpstra Trend Test CalculatorMcNemar Test CalculatorFisher Exact Test Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.