rline {LearnEDA} | R Documentation |
Fits Tukey's resistant line of form a + b (x - xC).
rline(x,y,iter=1)
x |
numeric vector of values of explanatory variable |
y |
numeric vector of values of response variable |
iter |
number of iterations of algorithm |
a |
value of intercept a |
b |
value of slope b |
xC |
value of xC |
half.slope.ratio |
value of half slope ratio after one iteration |
residual |
vector of residuals |
Jim Albert
x=1:10 y=3*x+rnorm(10,0,1) y[1]=20 fit=rline(x,y,iter=5) plot(x,y) curve(fit$a+fit$b*(x-fit$xC),add=TRUE) # contrast with least-squares fit abline(lm(y~x))