Description Usage Arguments Value Examples
Compute linear regression on data using formula and make it work with magrittr pipe operator.
1 |
data |
A dataframe, e.g. mtcars. |
formula |
A formula, e.g. mpg ~ wt. |
A modified dataframe containing the variables in the equation plus the fitted value and the residuals. The formula, model coefficients, variable correlation matrix and overall R^2 and AdjR^2 are attached to the dataframe as attributes.
1 2 3 4 5 | library(datasets)
library(dplyr)
library(regressR)
result <- linear_regression(mtcars, mpg ~ wt)
result2 <- mtcars %>% linear_regression(mpg ~ wt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.