line {eda} | R Documentation |
Robust Line Fitting
Description
Fit a line robustly as recommended in Exploratory Data Analysis.
Usage
line(x, y)
## S3 method for class 'tukeyline'
coef(object, ...)
## S3 method for class 'tukeyline'
residuals(object, type, ...)
## S3 method for class 'tukeyline'
fitted(object, ...)
## S3 method for class 'tukeyline'
print(x, digits = max(3, getOption("digits") - 3), ...)
Arguments
x , y |
the arguments can be any way of specifying x-y pairs. |
object |
a |
digits |
number of significant digits to use, see |
type , ... |
potentially further arguments, required by generic. |
Value
An object of class "tukeyline"
.
Methods are available for the generic functions coef
,
residuals
, fitted
, and print
.
References
Tukey, J. W. (1977). Exploratory Data Analysis, Reading Massachusetts: Addison-Wesley.
See Also
lm
.
Examples
library(eda)
data(cars)
plot(cars)
(z <- line(cars))
abline(coef(z))
## Tukey-Anscombe Plot :
plot(residuals(z) ~ fitted(z), main = deparse(z$call))