Math calculator

Quantile Regression Calculator

Not one slope.

Across the spread

Hourly pay against years of experience for 160 workers. Least squares reports a single figure: 0.6061 per year, for everyone. The quantile fits disagree with it and with each other — 0.2361 at the 10th percentile, 0.6006 at the median, 1.0800 at the 90th. An extra year is worth four and a half times as much near the top of the pay distribution as near the bottom, and the spread widens as experience accumulates. There is no one number here, and least squares reports one anyway.

160 rows · 1 predictor · five quantiles fitted

Slope runs 0.2361 at the 10th percentile to 1.0800 at the 90th — least squares says 0.6061

That is a 4.57-fold range across the distribution, which means there is no single slope to report. The least squares figure of 0.6061 is an average of effects that genuinely differ, and it describes the top of the distribution as badly as the bottom.

Lowest quantile slope

0.2361

at the 10th percentile

Median slope

0.6006

the 50th percentile fit

Highest quantile slope

1.0800

at the 90th percentile

Least squares

0.6061

± 0.120 — one number for all of it

The fit at each quantile

Slope, intercept and residual distribution at each quantile fitted
QuantileSlopeInterceptBelow the fitShare belowOn the fit
10th0.236116.6641150.09382
25th0.315317.5656390.24382
50th0.600617.8674790.49382
75th0.881718.34111190.74382
90th1.080019.51001430.89382

The share of observations below each fit tracks its quantile, which is what the estimator is for — the 10th percentile line has about a tenth of the data beneath it. The last column counts the observations the fit passes through exactly, and it is 2 every time, because a quantile fit is pinned by exactly as many points as it has parameters.

What one outlier does to each

Slope before and after moving one observation far from the fit
MethodSlopeAfter moving row 49Change
Least squares0.6061270.93857954.8%
Median regression0.6006290.600629none at all

Row 49 is the observation already furthest above the median fit, pushed twelve ranges further above it. Least squares moves by 0.3325 because squared error grows with distance, so one far-away point outweighs many near ones. The median fit does not move, and not approximately: it minimises absolute deviation, where only the side of an observation counts and never how far away it is.

Quantile regression describes the conditional distribution, not a causal effect. The slope at the 90th percentile is not the effect on people who are currently at the 90th percentile — a treatment can move individuals between quantiles. For outcomes with other shapes see censored regression or count models.

Five quantiles Least squares beside it Outlier test on every run Exact basic solution An even-returns preset

What this tool shows

Least squares reports 0.6061 per year of experience, for everyone. Quantile regression reports 0.2361 at the 10th percentile and 1.0800 at the 90th. A 4.57-fold range, on the same 160 rows. An extra year is worth four and a half times as much near the top of the pay distribution as near the bottom, and no single coefficient describes both ends. The second demonstration is exact: pushing one observation twelve ranges further from the fit moves the least squares slope by 54.8% and moves the median slope by nothing at all — 0.0e+0, on both presets and on eighty generated datasets.

  • Slopes at the 10th, 25th, 50th, 75th and 90th percentiles, with least squares beside them
  • The range across quantiles, which is the evidence for or against reporting one number
  • What a single outlier does to least squares and to the median fit, computed on every run
  • The share of observations below each fit, which must track its quantile
  • A preset where the quantile slopes agree and least squares is the right answer
  • The exact basic solution each fit lands on
Five quantiles Least squares beside it Outlier test every run Exact basic solution

One coefficient assumes the effect is the same everywhere in the distribution.

Updated 13 September 2026 · Works in any browser, no installation

Quantile regression fits a separate line to each part of the outcome distribution, so instead of one slope describing the average it gives the slope at the 10th percentile, the median, the 90th, and anywhere else you ask for. When those slopes agree, least squares was reporting a real quantity. When they do not, the average effect is a number describing nobody — and only fitting the quantiles reveals which case you are in.

At a glance

Formula shown
The fit at quantile τ minimises Σ ρ_τ(r) where ρ_τ(r) = τ·r for r ≥ 0 and (τ−1)·r for r < 0 — the asymmetric check function, which penalises being under by τ and over by 1−τ. At τ = 0.5 that is absolute deviation, so the fit is the conditional median. The solution interpolates exactly p observations, and about τ of the sample falls below it.
Scenario support
Pay gaps that differ between the bottom and the top of a distribution, house prices where the drivers of cheap and expensive properties differ, clinical measures with a skewed tail, response times where the slow tail matters more than the average, and any outcome with a few extreme values that would drag a mean fit.
Educational estimate
Planning support from the values you enter — not professional advice.

When there is no single slope to report

The wage preset has 160 workers, hourly pay, and years of experience. Least squares fits one line and reports 0.6061 per year — a clean, significant, publishable coefficient.

Fitting the quantiles separately gives 0.2361 at the 10th percentile, 0.3153 at the 25th, 0.6006 at the median, 0.8817 at the 75th and 1.0800 at the 90th. These are not five estimates of one number with noise around them. The spread of pay genuinely widens with experience, so an extra year is worth about 24p an hour to someone near the bottom of the pay distribution and about £1.08 to someone near the top.

The least squares figure sits in the middle and describes neither end. It is not wrong as an average — it is a correct answer to a question about the mean, presented in a setting where the mean is a poor summary. Nothing in the least squares output signals that: the coefficient is significant, the standard error is small, and the residual plot is the only hint, which is why so few people catch it.

The second preset is the control. Same design, same sample size, but the spread of pay does not change with experience. Now the quantile slopes run 0.4417 to 0.6298 — a 1.43-fold range rather than 4.57 — and the least squares figure of 0.5454 is a fair summary of all of them. That preset exists so the first is not read as a claim that least squares is always misleading. It is a claim that you cannot tell without looking.

The median fit does not move

Every run takes the observation already furthest above the median fit and pushes it twelve ranges further above, then refits both methods. This is a deliberate construction: the point stays on the side it was already on, and only its distance changes.

Least squares moves by 54.8% on the first preset and 59.2% on the second. Squared error grows with distance, so one observation far from the line can outweigh a hundred near it, and the fit tilts to chase it.

The median fit does not move. Not approximately — the measured shift is 0.0e+0, and it is 0.0e+0 on every one of eighty generated datasets in the verification suite. Absolute deviation grows linearly with distance, so the derivative of the objective with respect to a point’s position is just the sign of its residual. Move a point further away on the same side and the gradient is unchanged, so the solution is unchanged.

That is the precise form of the robustness claim, and it is worth stating precisely because the loose version is false. The median fit is not immune to outliers in general. It is immune to how far away they are. A point that crosses the fit changes the answer, and enough points crossing it will move the median fit as surely as any other.

What a quantile slope actually says

The 90th percentile slope describes how the 90th percentile of the outcome changes as the predictor changes. It does not describe the people who are currently at the 90th percentile, and this distinction does real damage when it is missed.

If a training programme raises the 90th percentile of earnings by £1,000, that does not mean the highest earners each gained £1,000. The programme may have moved different people into the top of the distribution entirely. Quantile regression describes the distribution at each level of the predictor; it does not track individuals between those distributions, and no amount of extra data makes it do so.

That also means the quantile slopes need not be ordered or even monotone. Crossing fits — where the 25th percentile line sits above the 75th at some values of the predictor — are possible, usually at the edges of the data where each fit is estimated from few points. It is a signal to distrust the fit out there rather than a paradox.

Why the fit passes through exactly p points

The table reports how many observations each fit passes through exactly, and the answer is always the number of parameters — two for an intercept and one predictor. That is not a coincidence of these datasets. The objective is piecewise linear, so its minimum sits at a vertex, and a vertex is where enough residuals are pinned to zero to determine the coefficients.

It matters here for a practical reason. An iterative solver only ever approaches such a vertex, so two runs on nearly identical data can land at slightly different coefficients — which would make the outlier comparison above meaningless, since a shift of 1e-3 could be the solver rather than the data. The fit is therefore snapped onto the exact vertex before anything is reported, and the suite confirms it interpolates exactly p observations in 300 of 300 fits.

The other check is the share of observations below each fit, which must track its quantile. The 10th percentile line should have about a tenth of the sample beneath it, and across the suite every fit lands within two observations of that.

Reporting it

Report several quantiles, not one, and report least squares beside them. The information a reader needs is whether the slopes agree: if they do, the least squares coefficient is a real summary and the quantile fits are the evidence for it. If they do not, the range is the finding.

Standard errors for quantile coefficients are usually obtained by bootstrap rather than a closed form, because the asymptotic variance involves the conditional density at the quantile, which is hard to estimate well. This page reports the fitted slopes and the range across them rather than intervals, which is the honest scope of what it computes.

Say plainly that a quantile slope describes the distribution rather than the individuals in it. That single sentence prevents the most common misreading, and it is almost never present.

Sources and methodology

References for the estimator and its computation.

Method. Each quantile fit is obtained by iteratively reweighted least squares on the check function with an annealed weight floor, then snapped onto its exact basic solution — the vertex interpolating exactly p observations, which the suite confirms in 300 of 300 fits. That step is what makes the outlier comparison reproducible: the measured shift in the median slope is exactly zero across eighty generated datasets while the least squares slope moves by 0.10 to 2.18. The suite separately confirms that the median fit beats least squares on absolute deviation and loses to it on squared deviation, that the share of residuals below each fit tracks its quantile to within two observations, and that scaling the outcome scales every quantile slope by the same factor. That engine is verified on every change against 490 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Linear RegressionThe least-squares line with r and r² — and the regression of x on y beside it, because those are two different lines rather than one line rearranged.
Multiple RegressionFits several predictors with a VIF on every term, and names the configuration people misread: a model significant at p = 0.0103 where neither predictor reaches 0.05, at a VIF of only 7.11.
TobitFit a censored regression to an outcome piled at a limit, with both least-squares alternatives beside it and the shortfall in each measured.
Theil-SenThe median-of-slopes estimator with a distribution-free interval, least squares beside it, and a leave-one-out table naming what each fit depends on.
PercentileThe value at any percentile and the percentile rank of any value, with all nine standard methods — and the round trip that shows the two directions are not inverses.
Trimmed MeanTrimmed and Winsorized means at any fraction, plotted across the full sweep — because a 0% trim is the arithmetic mean and a 50% trim is exactly the median, so the trim fraction is a dial between them.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. Quantile regression describes the conditional distribution of the outcome and does not track individuals between quantiles, so a quantile slope is not an effect on the people currently at that quantile. Standard errors for quantile coefficients generally require bootstrap methods and are not reported here; the page reports fitted slopes and the range across them.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published fits at five quantiles with least squares beside them on every run.
  2. Shipped a preset where the slope runs 0.2361 to 1.0800 across the distribution and least squares reports one number.
  3. Added an outlier test showing the median fit move by exactly zero while least squares moves 54.8%.
  4. Snapped each fit onto its exact basic solution so the comparison is reproducible.
  5. Stated that a quantile slope describes the distribution rather than the individuals in it.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.