knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of MLRnewbie is to provides functionality for conducting multiple linear regression analysis. The packages contains functions that can carry out model construction, residual calculation, and model sum of squares summary.
There are 3 functios:
linearRegression()
Generate linear model.
model_residuals()
Calculate linear model's residuals, including studentized residuals.
* ssmodel()
Summary SSR, SSE, and SSY for the linear model.
## Import the library library(MLRnewbie) ## Import data set mc <- mtcars
## Multiple linear regression with intercept ## We choose "cyl", "disp","hp" in mtcars as X, and "mpg" as Y. model_car <- linearRegression(data = mc, predictors = c("cyl", "disp","hp"), response = "mpg")
## Calculating useful residuals. From the left to right, they are Residual, Std_Residual, and Studentized_Residual. head(model_residuals(model_car))
## All three sum of squares of the linear regression model ssmodel(model_car)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.