Skip to contents

The least-squares line of x on y.

Usage

LsqRev(x, y)

Arguments

x, y

equal-length data vectors, n >= 2.

Value

list(C, D, S).

References

Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eq (6.50).

Examples

LsqRev(c(2, 3, 3, 5, 7), c(1, 1, 3, 4, 6))$C
#> [1] 0.8888889