Linear Deming Regression

deming perfoms a linear Deming regression. Useful when errors are present in both x and y variables.


Updated 29 Sep 2014

View License

[ b sigma2_x x_est y_est stats] = deming(x,y,lambda,alpha)
deming() performs a linear Deming regression to find the linear coefficients:
y = b(1) + b(2)*x
under the assumptions that x and y *both* contain measurement error with measurement error variance related as lambda = sigma2_y/sigma2_x (sigma2_x and sigma2_y is the measurement error variance of the x and y variables, respectively).
Computations are performed as described by Anders Christian Jenson in a May 2007 description of the Deming regression function for MethComp (web:, which includes a nice derivation of the slope, intercept, variance, and (x,y) estimates.

x - [Nx1] Measured data w/ error
y - [Nx1] Measured data w/ error
lambda - [1x1] [OPTIONAL] Relationship between measurement error expressed as ratio: sigma2_y / sigma2_x (default = 1)
alpha - [1x1] [OPTIONAL] Confidence level (default = 0.05)

b - [2x1] Intercept (1) and slope (2)
sigma2_x - [1x1] Error variance. Note: sigma2_y = lambda*sigma2_x
x_est - [Nx1] Estimated x values
y_est - [Nx1] Estimated y values
stats - [STR] Additional statistical information
.s_e - Standard error of regression estimate
.s_b - Jacknife estimate of the standard error of the slope and intercept
.t_c - *Critical t-value used for confidence intervals
.b_ci - *Confidence interval for slope and intercept

*stats.b_ci and stats.t_c are only available if the statistics package is installed and/or the tinv function is available.

Example is available by typing "help deming" at the command line.

Cite As

James Hall (2023). Linear Deming Regression (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Linear and Nonlinear Regression in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Corrected number of arguments required for default alpha value to be assigned.

Updated line 169 to correct standard error calculation for slope and intercept.