Theil Sen Regression Calculator
Fit a robust median pairwise-slope line with the joint median-residual intercept convention.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Ignore equal-X pairs for slope estimation and take the median of all remaining pair slopes, then the median residual intercept.
Slope=median((yj−yi)/(xj−xi)); intercept=median(yi−slope xi)
Worked example
For X=0,1,2,3,4 and Y=1,3,5,7,40 the median slope is 2 and intercept 1, giving prediction 11 at X=5.
Assumptions and input details
2–200 paired observations and at least two distinct X. Joint intercept convention, no confidence interval, causal inference, errors-in-X correction or outlier identification. Extrapolation is a fitted-line calculation only.
References: SciPy: Theil–Sen slope and joint intercept
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Fit y=a+bx to 2–100 entered coordinate pairs. Inspect the regression equation, correlation, R², predictions, residuals and a scatter plot.
Fit a straight line allowing measurement error in both X and Y with an explicitly entered error-variance ratio.
Calculate monotonic rank association for paired observations, including tied ranks.
Reserved advertising space.