weighted_line | R Documentation |
weighted_line
fits a robust line and allows weights.
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, ...)
x |
|
y |
|
w |
|
na.rm |
|
iter |
|
object |
object of class |
... |
additional arguments passed to the method. |
weighted_line
uses different quantiles for splitting the sample
than stats::line()
.
intercept and slope of the fitted line
Overview (of all implemented functions)
line
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.