Description Usage Arguments Details Value Author(s) References Examples
The formal model underlying the procedure is based on a so called functional relationship:
x_i=k_i + e_1i, y_i=alpha + beta k_i + e_2i
with var(e_1i)=s, var(e_2i)=VR*s, where VR is the known variance ratio.
1 2 3 4 5 6 7 8 9 |
x |
a numeric variable |
y |
a numeric variable |
vr |
The assumed known ratio of the (residual) variance of the |
sdr |
do. for standard deviations. Defaults to 1. |
boot |
Should bootstrap estimates of standard errors of parameters be done? If |
keep.boot |
Should the 4-column matrix of bootstrap samples be returned? If |
alpha |
What significance level should be used when displaying confidence intervals? |
The estimates of the residual variance is based on a weighting of the sum of squared deviations in both directions, divided by n-2. The ML estimate would use 2n instead, but in the model we actually estimate n+2 parameters — alpha, beta and the n k_i's. This is not in Peter Sprent's book (see references).
If boot==FALSE
a named vector with components
Intercept
, Slope
, sigma.x
, sigma.y
, where x
and y
are substituted by the variable names.
If boot==TRUE
a matrix with rows Intercept
,
Slope
, sigma.x
, sigma.y
, and colums giving the estimates,
the bootstrap standard error and the bootstrap estimate and c.i. as the 0.5,
alpha/2 and 1-alpha/2 quantiles of the sample.
If keep.boot==TRUE
this summary is printed, but a matrix with columns
Intercept
,
Slope
, sigma.x
, sigma.y
and boot
rows is returned.
Bendix Carstensen, Steno Diabetes Center, bendix.carstensen@regionh.dk, http://BendixCarstensen.com
Peter Sprent: Models in Regression, Methuen & Co., London 1969, ch.3.4.
WE Deming: Statistical adjustment of data, New York: Wiley, 1943.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 'True' values
M <- runif(100,0,5)
# Measurements:
x <- M + rnorm(100)
y <- 2 + 3 * M + rnorm(100,sd=2)
# Deming regression with equal variances, variance ratio 2.
Deming(x,y)
Deming(x,y,vr=2)
Deming(x,y,boot=TRUE)
bb <- Deming(x,y,boot=TRUE,keep.boot=TRUE)
str(bb)
# Plot data with the two classical regression lines
plot(x,y)
abline(lm(y~x))
ir <- coef(lm(x~y))
abline(-ir[1]/ir[2],1/ir[2])
abline(Deming(x,y,sdr=2)[1:2],col="red")
abline(Deming(x,y,sdr=10)[1:2],col="blue")
# Comparing classical regression and "Deming extreme"
summary(lm(y~x))
Deming(x,y,vr=1000000)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.