weighted_median_ratio | R Documentation |
A weighted median of the ratios y/x determines the slope of a regression through the origin.
weighted_median_ratio(x, y = NULL, w, na.rm = FALSE)
x |
|
y |
|
w |
|
na.rm |
|
A vector with two components: intercept and slope
Overview (of all implemented functions)
line
, weighted_line
and
weighted_median_line
x <- c(1,2,4,5)
y <- c(1,0,5,2)
m <- weighted_median_ratio(y ~ x, w = rep(1, length(y)))
m
coef(m)
fitted(m)
residuals(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.