Description Usage Arguments Value Examples
linearRegression is a mimic of lm() that is used to fit linear models.
1 | linearRegression(data, predictors, response, intercept = TRUE)
|
data |
The data set for multiple linear regression. It should be in the form of a 2d matrix |
predictors |
A string array of all the predictors' names. |
response |
A single string of the response. |
intercept |
Boolean. TRUE by default for a model with intercept. Setting as FALSE will force the model to have no intercept. |
A list with 6 elements: 1. beta_hat; 2.R^2; 3.X; 4.Fitted values; 5.Residuals; 6.intercept or not
1 2 | mt <- mtcars
linearRegression(mt, "mpg", "cyl", TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.