| linear_regression | R Documentation |
Functions to perform linear regression.
simple_ordinary_least_squares(x, y)
simple_ordinary_least_squares_with_R_squared(x, y)
x |
A numeric vector. |
y |
A numeric vector. |
A two-element numeric vector containing the intercept and slope of the regression line, or a three-element vector containing the intercept, slope, and R-squared value if applicable.
Boost Documentation for more details on the mathematical background.
# Simple Ordinary Least Squares
x <- c(1, 2, 3, 4, 5)
y <- c(2, 3, 5, 7, 11)
simple_ordinary_least_squares(x, y)
# Simple Ordinary Least Squares with R-squared
simple_ordinary_least_squares_with_R_squared(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.