1. Load library and dataset

library(boxlinre)
library(ggplot2)
library(gridExtra)

data(iris)

2. Create formula and fitting the model

formula = Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width
m = linreg$new( Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=iris)
m$summary()

The model is fitted and we can see the summary about coefficients.

3. Inspect the residuals

First the residuals:

resi<-m$resid()
summary(resi)


boxizhang/boxlinre documentation built on May 5, 2019, 1:37 p.m.