CalcWorldHub
Free online calculator · no signup

Theil Sen robust line estimate calculator

Estimate a line using the median of all finite pairwise slopes and a joint residual-median intercept.

4,000 tools
Theil Sen robust line estimate calculator — Predictor values, Response values and calculation method
Theil Sen robust line estimate calculator: inputs and calculation method.

How to use this calculator

Estimate a line using the median of all finite pairwise slopes and a joint residual-median intercept.

  1. Enter Predictor values, Response values. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Theil Sen robust line estimate explained

The Theil–Sen line uses the median slope across all nonvertical observation pairs, then the median of y−mx for its intercept. The result is less driven by individual extreme points than a least-squares line, but this page does not calculate an interval.

Theil–Sen slope1.1667
Theil–Sen slope: 1.16666667 in the worked scenario.

Inputs, symbols, and units

x — Predictor values
Predictor values. Use comma-separated values in the stated order.
y — Response values
Response values. Use comma-separated values in the stated order.

Formula and method

m = median[(yⱼ−yᵢ)/(xⱼ−xᵢ)] over i

Duplicate-x pairs do not define finite slopes, and at most 300 observations are accepted.

A worked scenario

Predictor values = 1, 2, 3, 4; Response values = 1, 2, 2, 5.

  • Theil–Sen slope: 1.16666667
  • Joint median intercept: -0.25 y units

For points (1,1), (2,2), (3,2), and (4,5), the median of the six pairwise slopes is 7/6. The median residual y−(7/6)x is −0.25.

Assumptions and edge cases

At most 300 pairs of observations; duplicate x pairs are skipped. No confidence interval is computed.

Frequently asked questions

Are vertical pairs used?

No, equal x values do not define a finite slope.

How is the intercept chosen?

Median of y−slope×x, the joint convention.

Is this identical to least squares?

No, it uses medians rather than minimizing squared residuals.

How do I use the Theil Sen robust line estimate calculator?

Enter Predictor values, Response values. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Theil Sen robust line estimate?

Predictor values = 1, 2, 3, 4; Response values = 1, 2, 2, 5. Theil–Sen slope: 1.16666667 Joint median intercept: -0.25 y units For points (1,1), (2,2), (3,2), and (4,5), the median of the six pairwise slopes is 7/6. The median residual y−(7/6)x is −0.25.