powered by
Fit a line robustly as recommended in Exploratory Data Analysis.
line(x, y)
the arguments can be any way of specifying x-y pairs. See xy.coords.
xy.coords
An object of class "tukeyline".
"tukeyline"
Methods are available for the generic functions coef, residuals, fitted, and print.
coef
residuals
fitted
print
Cases with missing values are omitted.
Long vectors are not supported.
Tukey, J. W. (1977). Exploratory Data Analysis, Reading Massachusetts: Addison-Wesley.
lm.
lm
# NOT RUN { require(graphics) plot(cars) (z <- line(cars)) abline(coef(z)) ## Tukey-Anscombe Plot : plot(residuals(z) ~ fitted(z), main = deparse(z$call)) # }
Run the code above in your browser using DataLab