How this calculation works
Enter X and Y measured on the same independent specimen or unit, using five through two hundred complete finite pairs. The calculation seeks a line relating two measurement procedures. Both procedures may contain measurement error, which distinguishes this setting from a model that regards X as an error-free fixed predictor. A useful comparison also needs observations spanning the relevant measurement range.
Sᵢⱼ=(yⱼ−yᵢ)/(xⱼ−xᵢ); exclude slope −1; K=#{S<−1}; slope=K-shifted median rank; intercept=median(y−slope x).A worked example
Six default pairs have15 positive slopes, K=0, Passing–Bablok slope2.02 and intercept0.05.
Good to know
5–200 complete independent paired finite observations. Full original Passing-Bablok convention with slopes equal to -1 excluded, equal-X vertical slopes handled per reference, rank adjustment and intercept median; analytical slope/intercept interval with explicit tie treatment only after validated. No PaBaLarge approximation, automatically assumed clinical acceptance or repeated-subject covariance.
Reference: Passing and Bablok (1983), original procedure (opens in a new tab) ↗
Treat each row as one paired measurement
Enter X and Y measured on the same independent specimen or unit, using five through two hundred complete finite pairs. The calculation seeks a line relating two measurement procedures. Both procedures may contain measurement error, which distinguishes this setting from a model that regards X as an error-free fixed predictor. A useful comparison also needs observations spanning the relevant measurement range.
The page uses the original Passing–Bablok slope-rank convention rather than a binned large-sample approximation. It does not analyze repeated measurements from a subject as if they were independent. A linear relationship is an assumption to examine, not an output guaranteed by the median construction. Curved response, strong heteroscedastic structure, or restricted range can make a single fitted line misleading.
Compare this with the Deming regression with entered measurement error ratio calculator. Fits robust ordered pairwise slopes with Passing-Bablok rank correction rather than minimizing Deming Gaussian quadratic errors with a supplied variance ratio. Existing Deming tool does not offer this rank-based estimator.
Construct a shifted median of pairwise slopes
For each unordered pair of observations, form the change in Y divided by the change in X. Identical observations contribute no defined slope. Equal-X pairs with differing Y are vertical and require the method's signed-infinity convention instead of simple omission. Slopes exactly equal to minus one are excluded, and K counts the retained slopes smaller than minus one.
Sort retained slopes and apply the original K rank shift to the median position, averaging the two central shifted slopes for an even number where defined. The intercept is the median of Y minus fitted slope times X. An ordinary unshifted median of slopes is a different estimator in datasets with relevant negative slopes, even though it agrees with this method in the positive-slope default.
Rank intervals need their own validity checks
For the classical continuous-data analytical interval, the rank spread uses the normal quantile times the square root of n(n-1)(2n+5)/18. The retained-slope count and that spread define lower and upper order-statistic ranks, followed by the same K shift. The procedure must declare its integer-rounding convention and handle ranks that reach the boundary rather than hiding them by unexplained clipping.
Corresponding intercept limits use the medians of Y minus upper-slope times X and Y minus lower-slope times X. These are parameter intervals rather than a prediction band. Tied measurement coordinates, excluded slopes, and vertical slopes can affect analytical treatment. Where the supported interval convention is not validated for a tied or boundary case, report the point fit with an explicit unavailable interval instead of implying exact inference.
Six increasing pairs provide a checkable fit
The default X values are one through six, and Y is 2.1, 3.8, 6.2, 8.1, 9.9, and 12.2. All fifteen pairwise slopes are positive, so no minus-one exclusion or negative-rank shift occurs. Their median is 2.02. This clean example tests the basic pair enumeration while leaving difficult negative or vertical configurations for separate boundary validation.
Using slope 2.02, the median of the six residual intercepts Y minus 2.02 X is 0.05. The fitted relationship is therefore Y approximately 0.05 plus 2.02 X. The result reflects a clear proportional difference from the identity line in these synthetic measurements. It does not by itself establish the uncertainty of a future measurement or whether the difference is acceptable for a real application.
Compare fitted and identity lines
The static figure shows the paired measurements, their fitted line, and the identity reference Y equals X on the same axes. The identity line represents numerical equality of procedures in common units. The fitted slope and intercept describe systematic scale and offset patterns. A narrow cloud around a line can coexist with large systematic disagreement if that line is far from identity.
A slope near one and intercept near zero are useful descriptive targets but do not certify interchangeability. A parameter interval containing the corresponding identity value means the data did not reject that value under the chosen procedure; it is not a formal equivalence conclusion. Clinical or engineering acceptance requires prespecified tolerances and an analysis of differences at relevant decision levels.
Robust does not mean assumption-free
Using medians reduces sensitivity to some extreme points compared with ordinary least squares, but it does not make every sampling distribution or error structure harmless. The original method was developed for strongly associated measurement pairs and a linear relationship. Rounded values, a large share of duplicated specimens, or a nearly vertical relation can create ambiguous ranks or a nonfinite slope estimate.
The two-hundred-pair cap bounds the quadratic number of pairwise slopes. No PaBaLarge binning, repeated-subject correction, CUSUM assessment, or automatic method-acceptance rule is supplied. Any displayed confidence level describes only a validated interval calculation under its assumptions. A good numerical fit cannot repair a design in which the sampled specimens omit the concentration range where method differences matter most.
Choose the regression target deliberately
Ordinary least squares minimizes vertical squared residuals under a different error model. Deming regression uses a specified ratio of measurement-error variances. Passing–Bablok uses pairwise rank structure and the stated original convention. These methods need not return the same slope for the same measurements, and disagreement is not automatically evidence of an implementation problem. Select the method according to the measurement comparison question.
Keep the full pairs, orientation of X and Y, retained slope count, number excluded, K shift, slope, intercept, interval method, rounding rule, and any unavailable-interval warning. Examine a scatterplot and differences over the measurement range. If the relation is curved or the paired errors have an unsuitable structure, obtain a more appropriate analysis instead of using robustness as a reason to accept a linear comparison uncritically.
A few questions, answered
Is this the ordinary median-slope estimator?
It uses the original Passing–Bablok minus-one exclusion and K rank shift. It can differ from an unshifted Theil–Sen median.
How are repeated specimens handled?
They are not modeled as dependent units here; the input rows must be independent complete pairs.
Does an interval containing slope one prove equivalence?
No. Equivalence requires a separately defined acceptance margin and an appropriate inferential design.
Can tied inputs suppress the analytical interval?
Yes. An interval is only reported when the implemented rank and tie convention is validated; a point fit can remain available.