line {eda} | R Documentation |
This function fits a line robustly as recommended in John Tukey's book Exploratory Data Analysis.
line(x, y)
coefficients(tukeyline.obj)
residuals(tukeyline.obj)
fitted.values(tukeyline.obj)
print(tukeyline.obj)
x , y |
the arguments can be any way of specifying x-y pairs. |
An object of class tukeyline
. Methods are available
for the generic functions coefficients
, residuals
,
fitted.values
and print
.
Tukey, J. W. (1977). Exploratory Data Analysis, Reading Massachusetts: Addison-Wesley.
lm
.
library(eda)
data(cars)
plot(cars)
z <- line(cars)
abline(coef(z))