linear1 is intended to mimic the original R function lm
, which stands for linear regression.
It currently has two functions:
lm1
reads the formula of a linear model and return an invisible list of values of the linear model. summary1
reads the return value of lm1
and mimics the output of the original summary
function based on lm
. diagnosis
reads the return value of lm1
and returns different types residuals of the model. At the same time it prints a plot consisting of residual plot, qqplot, scale-location plot and standardized residuals vs leverage plot, which in some extend mimics the original function plot
based on lm
. devtools::install_github("mengqi00/linear1")
library(linear1)
### fit a linear model
model <- lm1(mpg ~ disp + wt, data = mtcars)
### get summaries of the model's results
summary1(model)
### get residuals and plot
diagnosis(model)
There are help pages for each function, use help(lm1), help(summary1), and help(diagnosis) to see more examples.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.