weighted_line {robsurvey} | R Documentation |
Weighted Robust Line Fitting
Description
weighted_line
fits a robust line and allows weights.
Usage
weighted_line(x, y = NULL, w, na.rm = FALSE, iter = 1)
## S3 method for class 'medline'
print(x, ...)
## S3 method for class 'medline'
coef(object, ...)
## S3 method for class 'medline'
residuals(object, ...)
## S3 method for class 'medline'
fitted(object, ...)
Arguments
x |
|
y |
|
w |
|
na.rm |
|
iter |
|
object |
object of class |
... |
additional arguments passed to the method. |
Details
weighted_line
uses different quantiles for splitting the sample
than stats::line()
.
Value
intercept and slope of the fitted line
See Also
Overview (of all implemented functions)
Examples
head(cars)
# compute weighted line
weighted_line(cars$speed, cars$dist, w = rep(1, length(cars$speed)))
m <- weighted_line(cars$speed, cars$dist, w = rep(1:10, each = 5))
m
coef(m)
residuals(m)
fitted(m)
[Package robsurvey version 0.6 Index]