rline {LearnEDA} | R Documentation |
Resistant line
Description
Fits Tukey's resistant line of form a + b (x - xC).
Usage
rline(x,y,iter=1)
Arguments
x |
numeric vector of values of explanatory variable |
y |
numeric vector of values of response variable |
iter |
number of iterations of algorithm |
Value
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 |
Author(s)
Jim Albert
Examples
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))
[Package
LearnEDA version 1.0
Index]