rline: Resistant line

Description Usage Arguments Value Author(s) Examples

Description

Fits Tukey's resistant line of form a + b (x - xC).

Usage

1
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

residual

vector of residuals

spoints.x

vector of summary x coordinates

spoints.y

vector of summary y coordinates

Author(s)

Jim Albert

Examples

1
2
3
4
5
6
7
8
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))

bayesball/LearnEDA documentation built on May 11, 2019, 9:22 p.m.